diff options
Diffstat (limited to 'themes/m10c/layouts')
-rw-r--r-- | themes/m10c/layouts/404.html | 7 | ||||
-rw-r--r-- | themes/m10c/layouts/_default/baseof.html | 54 | ||||
-rw-r--r-- | themes/m10c/layouts/_default/list.html | 17 | ||||
-rw-r--r-- | themes/m10c/layouts/_default/single.html | 34 | ||||
-rw-r--r-- | themes/m10c/layouts/_default/terms.html | 16 | ||||
-rw-r--r-- | themes/m10c/layouts/partials/icon.html | 12 | ||||
-rw-r--r-- | themes/m10c/layouts/partials/pagination.html | 27 |
7 files changed, 167 insertions, 0 deletions
diff --git a/themes/m10c/layouts/404.html b/themes/m10c/layouts/404.html new file mode 100644 index 0000000..7009c19 --- /dev/null +++ b/themes/m10c/layouts/404.html @@ -0,0 +1,7 @@ +{{ define "main" }} + <div class="error-404"> + <h1 class="error-404-title">O{{ partial "icon.html" (dict "ctx" $ "name" "frown") }}ps... </h1> + <p>The link you followed may be broken, or the page may have been removed.</p> + <a href="{{ "/" | relURL }}">Go home {{ partial "icon.html" (dict "ctx" $ "name" "arrow-right") }}</a> + </div> +{{ end }} diff --git a/themes/m10c/layouts/_default/baseof.html b/themes/m10c/layouts/_default/baseof.html new file mode 100644 index 0000000..bb31bd0 --- /dev/null +++ b/themes/m10c/layouts/_default/baseof.html @@ -0,0 +1,54 @@ +<!doctype html> +<html lang="{{ .Site.LanguageCode | default "en-us" }}"> + <head> + <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} // {{ .Site.Title }}{{ end }}</title> + <meta charset="utf-8" /> + {{ hugo.Generator }} + <meta name="viewport" content="width=device-width, initial-scale=1" /> + <meta name="author" content="{{ .Site.Params.author | default "John Doe" }}" /> + <meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" /> + {{ $style := resources.Get "css/main.scss" | resources.ExecuteAsTemplate "css/main.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint -}} + <link rel="stylesheet" href="{{ $style.Permalink }}" /> + <link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' /> + + {{ template "_internal/google_analytics.html" . }} + {{ template "_internal/twitter_cards.html" . }} + {{ template "_internal/opengraph.html" . }} + + <!-- Matomo --> + <script type="text/javascript"> + var _paq = window._paq || []; + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ + _paq.push(["setDocumentTitle", document.domain + "/" + document.title]); + _paq.push(["setDomains", ["*.blog.rogs.me"]]); + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="//analytics.rogs.me/"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', '2']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); + })(); + </script> + <!-- End Matomo Code --> + + </head> + <body> + <header class="app-header"> + <a href="{{ .Site.BaseURL }}"><img class="app-header-avatar" src="{{ .Site.Params.avatar | default "avatar.jpg" | relURL }}" alt="{{ .Site.Params.author | default "John Doe" }}" /></a> + <h1>{{ .Site.Title }}</h1> + <p>{{ .Site.Params.description | default "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vehicula turpis sit amet elit pretium." }}</p> + <div class="app-header-social"> + {{ range .Site.Params.social }} + <a target="_blank" href="{{ .url }}" rel="noreferrer noopener">{{ partial "icon.html" (dict "ctx" $ "name" .name ) }}</a> + {{ end }} + </div> + </header> + <main class="app-container"> + {{ block "main" . }} + {{ .Content }} + {{ end }} + </main> + </body> +</html> diff --git a/themes/m10c/layouts/_default/list.html b/themes/m10c/layouts/_default/list.html new file mode 100644 index 0000000..392c5e2 --- /dev/null +++ b/themes/m10c/layouts/_default/list.html @@ -0,0 +1,17 @@ +{{ define "main" }} + <article> + <h1>{{ .Title }}</h1> + <ul class="posts-list"> + {{ range $index, $element := .Paginator.Pages }} + <li class="posts-list-item"> + <a class="posts-list-item-title" href="{{ .Permalink }}">{{ .Title }}</a> + <span class="posts-list-item-description"> + {{ partial "icon.html" (dict "ctx" $ "name" "clock") }} {{ .ReadingTime }} min read - + {{ .PublishDate.Format "Jan 2, 2006" }} + </span> + </li> + {{ end }} + </ul> + {{ partial "pagination.html" $ }} + </article> +{{ end }} diff --git a/themes/m10c/layouts/_default/single.html b/themes/m10c/layouts/_default/single.html new file mode 100644 index 0000000..53cc794 --- /dev/null +++ b/themes/m10c/layouts/_default/single.html @@ -0,0 +1,34 @@ +{{ define "main" }} + <article class="post"> + <header class="post-header"> + <h1 class ="post-title">{{ .Title }}</h1> + <div class="post-meta"> + <div> + {{ partial "icon.html" (dict "ctx" $ "name" "calendar") }} + {{ .PublishDate.Format "Jan 2, 2006" }} + </div> + <div> + {{ partial "icon.html" (dict "ctx" $ "name" "clock") }} + {{ .ReadingTime }} min read + </div> + {{- with .Params.tags -}} + <div> + {{ partial "icon.html" (dict "ctx" $ "name" "tag") }} + {{ range . -}} + {{- with $.Site.GetPage (printf "/%s/%s" "tags" . ) -}} + <a class="tag" href="{{ .Permalink }}">{{ .Title }}</a> + {{- end -}} + {{- end -}} + </div> + {{- end -}} + </div> + </header> + <div class="post-content"> + {{ .Content }} + </div> + <div class="post-footer"> + <script defer src="https://commento.rogs.me/js/commento.js"></script> + <div id="commento"></div> + </div> + </article> +{{ end }} diff --git a/themes/m10c/layouts/_default/terms.html b/themes/m10c/layouts/_default/terms.html new file mode 100644 index 0000000..efce125 --- /dev/null +++ b/themes/m10c/layouts/_default/terms.html @@ -0,0 +1,16 @@ +{{ define "main" }} + <article> + <h1>{{ .Title }}</h1> + <ul class="posts-list"> + {{ range .Data.Terms.Alphabetical }} + <li class="posts-list-item"> + <a class="posts-list-item-title" href="{{ .Page.Permalink }}"> + {{ .Page.Title }} + </a> + {{ .Count }} + </li> + {{ end }} + </ul> + {{ partial "pagination.html" $ }} + </article> +{{ end }} diff --git a/themes/m10c/layouts/partials/icon.html b/themes/m10c/layouts/partials/icon.html new file mode 100644 index 0000000..123bd23 --- /dev/null +++ b/themes/m10c/layouts/partials/icon.html @@ -0,0 +1,12 @@ +{{- if isset .ctx.Site.Data.m10c.icons .name -}} +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-{{ .name }}"> + <title>{{ .name }}</title> + {{ safeHTML (index .ctx.Site.Data.m10c.icons .name) }} +</svg> +{{- else -}} +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-link"> + <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path> + <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path> +</svg> +{{- end -}} + diff --git a/themes/m10c/layouts/partials/pagination.html b/themes/m10c/layouts/partials/pagination.html new file mode 100644 index 0000000..be6fa11 --- /dev/null +++ b/themes/m10c/layouts/partials/pagination.html @@ -0,0 +1,27 @@ +{{ with $.Paginator }} +{{ if gt .TotalPages 1 }} +<ul class="pagination"> + {{ with .Prev }} + <li class="page-item"> + <a class="page-link" href="{{ .URL }}"> + {{ partial "icon.html" (dict "ctx" $ "name" "arrow-left") }} + </a> + </li> + {{ end }} + {{ range .Pagers }} + <li class="page-item{{ if eq .PageNumber $.Paginator.PageNumber }} active{{ end }}"> + <a class="page-link" href="{{ .URL }}"> + {{ .PageNumber }} + </a> + </li> + {{ end }} + {{ with .Next }} + <li class="page-item"> + <a class="page-link" href="{{ .URL }}"> + {{ partial "icon.html" (dict "ctx" $ "name" "arrow-right") }} + </a> + </li> + {{ end }} +</ul> +{{ end }} +{{ end }} |