Initial version
This commit is contained in:
commit
ed5653a7fc
211 changed files with 11043 additions and 0 deletions
3
themes/zen/layouts/partials/author-date.html
Normal file
3
themes/zen/layouts/partials/author-date.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{ with $.Param "author" | default site.Author.name }}<span class="author" itemprop="author">{{ . }}</span>{{ end -}}
|
||||
{{ if and .Date (or ($.Param "author") site.Author.name) }} - {{ end -}}
|
||||
{{ with .Date }}<time class="created-date" datetime="{{ .Format "2006-01-02T15:04:05Z07:00" }}">{{ .Format ($.Param "dateformat" | default "2 January, 2006") }}</time>{{ end }}
|
10
themes/zen/layouts/partials/cookieconsent.html
Normal file
10
themes/zen/layouts/partials/cookieconsent.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<div class="cookieconsent layout__cookieconsent hidden">
|
||||
<div class="cookieconsent__message">
|
||||
{{ i18n "cookieconsent_message" }}
|
||||
{{ with site.Params.privacyPolicyUrl }}<a href="{{ . }}">{{ i18n "privacy_policy" }}</a>{{ end }}
|
||||
</div>
|
||||
<div class="cookieconsent__actions">
|
||||
<button class="button button--small button--cookieconsent button--decline" type="button" data-consent="false">{{ i18n "cookieconsent_decline" }}</button>
|
||||
<button class="button button--small button--cookieconsent button--accept" type="button" data-consent="true">{{ i18n "cookieconsent_accept" }}</button>
|
||||
</div>
|
||||
</div>
|
4
themes/zen/layouts/partials/dates.html
Normal file
4
themes/zen/layouts/partials/dates.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div class="content-dates meta">
|
||||
{{ i18n "last_mod" }} {{ .Lastmod.Format ($.Param "dateformat" | default "2 January, 2006") }}<br>
|
||||
{{ i18n "created" }} {{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}
|
||||
</div>
|
8
themes/zen/layouts/partials/feedlinks.html
Normal file
8
themes/zen/layouts/partials/feedlinks.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
{{ $list := .AlternativeOutputFormats -}}
|
||||
{{ $length := (len $list) -}}
|
||||
{{ if $list -}}
|
||||
<p>{{ i18n "string_follow" | title }}{{ with .Section }} {{ . }}{{ end }}: {{ range $index, $element := $list -}}
|
||||
<a rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">{{ .Name }}</a>{{ if ne (add $index 1) $length }} | {{ end }}
|
||||
{{- end -}}
|
||||
</p>
|
||||
{{ end -}}
|
19
themes/zen/layouts/partials/language-selector.html
Normal file
19
themes/zen/layouts/partials/language-selector.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<nav class="language-selector layout__language-selector" aria-label="{{ i18n "lang_select_title" }}">
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" class="language-icon" width="24" height="24" viewBox="0 0 961 1113">
|
||||
<path d="M848 3a17654 17654 0 00-349 118l-39 13-6 2-171-60-173-62c-2 0-2 6-2 118v119l-50 16-53 19c-5 3-5-19-5 343 0 335 0 336 2 339l6 5a92499 92499 0 00459-150l12-4 10 3 467 148 4 2V302l-45-15-45-14-1-132c0-124-1-132-2-134-4-7-9-8-19-5zm-4 145l-1 117-178-57-178-57L843 30l1 118zM458 481l-1 319-216 72-216 72V305l215-72 217-72 1 320zm262-131c17 4 30 9 30 9 1 0 20 67 42 149l57 203 15 56-64-19a2060 2060 0 01-24-84 2094 2094 0 00-130-40l-15 33-14 34-64-18 22-55 55-136 46-112c10-24 13-30 14-30l31 10z"/>
|
||||
<path d="M257 360l-35 9c-23 7-25 7-34 7a72 72 0 01-20-3c-1 1 2 11 5 18 4 8 13 17 23 21 6 3 7 3 18 3 19 0 37-6 52-17 12-8 16-18 15-29-2-11-8-13-24-9zM335 413l-35 16c-13 7-23 12-28 13l-38 12a1636 1636 0 01-106 32c-19 3-17 2-17 9l2 8c2 4 9 10 14 12 12 6 42 3 51-6 2-2 3-3 3-7v-6l31-10 40-11a515 515 0 0148-13l-48 96c-10 19-23 40-45 71l-52 71-55 64-7 8h4c7 0 17-2 20-4a929 929 0 00149-179l23 17c26 20 30 23 51 35 25 14 39 21 56 27 8 2 12 3 13 1 1-4-6-30-9-33l-26-12-47-20-40-17-16-7 10-17c22-35 34-56 53-95l20-40 1-10v-11h-3l-17 6zM716 451l-23 56-23 55 86 26a4814 4814 0 00-40-137zM680 972a460 460 0 0026 44 422 422 0 01-319 66 517 517 0 01-175-66c-7-3-14-2-17 4-2 3-2 9 0 12s24 16 46 27a536 536 0 00222 53c36 1 39 0 68-4a480 480 0 00181-65l8-5 12 21 13 19 7-19 17-48 10-32-99-7z"/>
|
||||
</svg>
|
||||
<ul class="navbar">
|
||||
{{ if .IsTranslated -}}
|
||||
{{ range .Translations -}}
|
||||
<li><a rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Site.LanguageCode | default .Lang }}" lang="{{ .Site.LanguageCode | default .Lang }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ range site.Languages -}}
|
||||
{{ if ne site.Language.Lang .Lang -}}
|
||||
<li><a rel="alternate" href="{{ .Lang | relURL }}" hreflang="{{ .Lang }}" lang="{{ .Lang }}">{{ .LanguageName }}</a></li>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</nav>
|
11
themes/zen/layouts/partials/math.html
Normal file
11
themes/zen/layouts/partials/math.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
{{ $opts := dict "minify" true -}}
|
||||
{{ if eq hugo.Environment "development" -}}
|
||||
{{ $opts = merge $opts (dict "minify" false) -}}
|
||||
{{ end -}}
|
||||
{{ if or ($.Param "math") (.Page.Store.Get "math") (.HasShortcode "math") -}}
|
||||
<link rel="stylesheet" href="{{ "katex/katex.min.css" | relURL }}">
|
||||
<script defer src="{{ "katex/katex.min.js" | relURL }}"></script>
|
||||
<script defer src="{{ "katex/contrib/auto-render.min.js" | relURL }}"></script>
|
||||
{{ $math := resources.Get "js/math.js" | js.Build $opts | fingerprint -}}
|
||||
<script defer src="{{ $math.RelPermalink }}"></script>
|
||||
{{ end -}}
|
25
themes/zen/layouts/partials/menu.html
Normal file
25
themes/zen/layouts/partials/menu.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
<nav class="main-menu{{ if not ($.Param "menuinheader") }} layout__navigation{{ end }}" aria-label="{{ i18n "menu_title" }}">
|
||||
<ul class="navbar">
|
||||
{{ if site.Menus.main -}}
|
||||
|
||||
{{ $currentPage := . -}}
|
||||
{{ range site.Menus.main -}}
|
||||
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} aria-current="page"{{ end }}>{{ .Pre }}<span>{{ .Name }}</span>{{ .Post }}</a></li>
|
||||
{{ end -}}
|
||||
|
||||
{{ else -}}
|
||||
|
||||
{{ $currentSection := .Section -}}
|
||||
{{ $currentID := "" -}}
|
||||
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
|
||||
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
|
||||
{{ range where site.RegularPages "Section" "" -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
{{ range site.Sections -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</nav>
|
30
themes/zen/layouts/partials/meta.html
Normal file
30
themes/zen/layouts/partials/meta.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" {{ printf "type=%q" .MediaType.Type | safeHTMLAttr }} title="{{ .Name }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
<meta name="description" content="{{ with (.Description | default (replaceRE "\n" " " (.Plain | truncate 170))) }}{{ . }}{{ end }}">
|
||||
<meta name="created" {{ printf "content=%q" (.Date.Format "2006-01-02T15:04:05-0700") | safeHTMLAttr }}>
|
||||
<meta name="modified" {{ printf "content=%q" (.Lastmod.Format "2006-01-02T15:04:05-0700") | safeHTMLAttr }}>
|
||||
{{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }}
|
||||
<meta property="og:site_name" content="{{ site.Title }}">
|
||||
<meta property="og:title" content="{{ .Title }}">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
|
||||
{{ with $.Param "image" }}<meta property="og:image" content="{{ . | absURL }}">{{ end }}
|
||||
{{ hugo.Generator }}
|
||||
<meta name="msapplication-TileColor" content="{{ $.Param "themecolor" | default "#ffffff" }}">
|
||||
<meta name="theme-color" content="{{ $.Param "themecolor" | default "#ffffff" }}">
|
||||
{{ with site.Params.piwikTrackerUrl }}<link rel="dns-prefetch" href="https://{{ . }}">{{ end }}
|
||||
{{ with $.Param "microusername" }}<link rel="me" href="https://micro.blog/{{ . }}">{{ end }}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ if .IsTranslated -}}
|
||||
{{ range .Translations -}}
|
||||
<link rel="alternate" hreflang="{{ .Site.LanguageCode | default .Lang }}" href="{{ .Permalink }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}">
|
||||
{{ if $.Param "realfavicongenerator" -}}
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | relURL }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | relURL }}">
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}">
|
||||
{{ end -}}
|
29
themes/zen/layouts/partials/meta_breadcrumb_json_ld.html
Normal file
29
themes/zen/layouts/partials/meta_breadcrumb_json_ld.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
{{ $breadcrumbScratch := newScratch -}}
|
||||
{{ $crumbScratch := newScratch -}}
|
||||
{{ $crumbScratch.Set "itemListElement" (slice) -}}
|
||||
{{ $breadPos := 0 -}}
|
||||
{{ range .Ancestors.Reverse -}}
|
||||
{{ $breadPos = (add $breadPos 1) -}}
|
||||
{{ $crumbScratch.Add "itemListElement" (dict
|
||||
"@type" "ListItem"
|
||||
"position" $breadPos
|
||||
"item" (dict
|
||||
"@id" .Permalink
|
||||
"name" .LinkTitle
|
||||
)
|
||||
) -}}
|
||||
{{ end -}}
|
||||
{{ $breadPos = (add $breadPos 1) -}}
|
||||
{{ $crumbScratch.Add "itemListElement" (dict
|
||||
"@type" "ListItem"
|
||||
"position" $breadPos
|
||||
"item" (dict
|
||||
"@id" .Permalink
|
||||
"name" .LinkTitle
|
||||
)
|
||||
) -}}
|
||||
{{ $breadcrumbScratch.SetInMap "breadcrumb" "@context" "https://schema.org" -}}
|
||||
{{ $breadcrumbScratch.SetInMap "breadcrumb" "@type" "BreadcrumbList" -}}
|
||||
{{ $breadcrumbScratch.SetInMap "breadcrumb" "itemListElement" ($crumbScratch.Get "itemListElement") -}}
|
||||
{{ $jsonifiedBreadcrumb := $breadcrumbScratch.Get "breadcrumb" | jsonify (dict "indent" " " "prefix" " ") -}}
|
||||
{{ return ($jsonifiedBreadcrumb | safeJS) -}}
|
58
themes/zen/layouts/partials/meta_json_ld.html
Normal file
58
themes/zen/layouts/partials/meta_json_ld.html
Normal file
|
@ -0,0 +1,58 @@
|
|||
<script type="application/ld+json">
|
||||
{{ $blogSections := site.Params.blogSections | default (slice "blog" "post") -}}
|
||||
{{ $breadcrumbSections := site.Params.breadcrumbSections | default (slice) -}}
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
{{ if .IsPage -}}
|
||||
"@type": {{ if in $blogSections .Section }}"BlogPosting",{{ else }}"WebPage",
|
||||
{{ if in $breadcrumbSections .Section -}}
|
||||
"breadcrumb": {{ partial "meta_breadcrumb_json_ld.html" . }},
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
"headline": {{ .Title }},
|
||||
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
|
||||
"url" : {{ .Permalink }},
|
||||
{{ with (.Description | default (replaceRE "\n" " " (.Plain | truncate 170))) -}}
|
||||
"description": {{ . }},
|
||||
{{ end -}}
|
||||
{{ with .Params.tags -}}
|
||||
"keywords": {{ . }},
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
"@type": "WebPage",
|
||||
{{ if in $breadcrumbSections .Section -}}
|
||||
"breadcrumb": {{ partial "meta_breadcrumb_json_ld.html" . }},
|
||||
{{ end -}}
|
||||
"url" : {{ .Permalink }},
|
||||
"name": {{ .Title }},
|
||||
{{ with $.Param "description" -}}
|
||||
"description": {{ . }},
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ with $.Param "image" -}}
|
||||
"image" : {{ . | absURL }},
|
||||
{{ end -}}
|
||||
{{ with $.Param "author" -}}
|
||||
"author": {
|
||||
"@type": "Person",
|
||||
"name": {{ . }}
|
||||
},
|
||||
{{ end -}}
|
||||
"mainEntityOfPage": {
|
||||
"@type": "WebPage",
|
||||
"@id": {{ site.BaseURL }}
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "Organization",
|
||||
"name": {{ site.Title }},
|
||||
{{ with $.Param "icon" -}}
|
||||
"logo" : {
|
||||
"@type": "ImageObject",
|
||||
"url": {{ . | absURL }}
|
||||
},
|
||||
{{ end -}}
|
||||
"url": {{ site.BaseURL }}
|
||||
}
|
||||
}
|
||||
</script>
|
39
themes/zen/layouts/partials/mobilemenu.html
Normal file
39
themes/zen/layouts/partials/mobilemenu.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
<div class="mobile-nav" dir="ltr">
|
||||
<div class="mobile-nav__cover"></div>
|
||||
<button class="mobile-nav__toggle{{ if $.Param "mobilemenuoutline" }} button--outline{{ end }}" aria-expanded="false" aria-controls="sheet">
|
||||
{{ i18n "menu_mobile" }}
|
||||
<svg class="mobile-nav__hamburger" viewBox="0 0 100 100" focusable="false" aria-hidden="true">
|
||||
<rect width="80" height="12" x="10" y="20" rx="5"></rect>
|
||||
<rect width="80" height="12" x="10" y="45" rx="5"></rect>
|
||||
<rect width="80" height="12" x="10" y="70" rx="5"></rect>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="mobile-nav__sheet link-inverted link-nav" id="sheet" aria-hidden="true">
|
||||
<div class="mobile-nav__region">{{ if site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end }}</div>
|
||||
<nav class="mobile-nav__main-menu" aria-label="{{ i18n "menu_title" }}">
|
||||
<ul class="mobile-nav__navbar">
|
||||
{{ if site.Menus.main -}}
|
||||
|
||||
{{ $currentPage := . -}}
|
||||
{{ range site.Menus.main -}}
|
||||
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} aria-current="page"{{ end }}>{{ .Pre }}<span>{{ .Name }}</span>{{ .Post }}</a></li>
|
||||
{{ end -}}
|
||||
|
||||
{{ else -}}
|
||||
|
||||
{{ $currentSection := .Section -}}
|
||||
{{ $currentID := "" -}}
|
||||
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
|
||||
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
|
||||
{{ range where site.RegularPages "Section" "" -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
{{ range site.Sections -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
14
themes/zen/layouts/partials/pagination.html
Normal file
14
themes/zen/layouts/partials/pagination.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
{{ if $.Param "internalpagination" -}}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
{{ else -}}
|
||||
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) -}}
|
||||
<nav class="pager">
|
||||
{{ if .Paginator.HasPrev -}}
|
||||
<a href="{{ .Paginator.Prev.URL }}" rel="prev" class="pager__item pager__item--prev"><span aria-hidden="true">« </span>{{ i18n "pager_prev" }}</a>
|
||||
{{ end -}}
|
||||
{{ if .Paginator.HasNext -}}
|
||||
<a href="{{ .Paginator.Next.URL }}" rel="next" class="pager__item pager__item--next">{{ i18n "pager_next" }}<span aria-hidden="true"> »</span></a>
|
||||
{{ end -}}
|
||||
</nav>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
12
themes/zen/layouts/partials/podcast.html
Normal file
12
themes/zen/layouts/partials/podcast.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
{{ $src := (.Params.podcast.mp3 | absURL) -}}
|
||||
{{ if site.Params.Podcast.cdn -}}
|
||||
{{ $src = add site.Params.Podcast.cdn (.Params.podcast.mp3 | relURL) -}}
|
||||
{{ end -}}
|
||||
<figure class="podcast">
|
||||
<audio controls preload="{{ site.Params.Podcast.preload | default "metadata" }}"><source src="{{ $src }}" type="audio/mpeg"></audio>
|
||||
<figcaption><a href="{{ $src }}">{{ .Title }}</a></figcaption>
|
||||
</figure>
|
||||
{{ with .Params.podcast.image }}
|
||||
{{ $resource := resources.Get .src }}{{ $size := "250x" }}{{ with .width }}{{ $size = (add (string .) "x") }}{{ end }}{{ $image := $resource.Resize $size -}}
|
||||
<figure class="image {{ .class | default "right" }}"><img src="{{ $image.RelPermalink }}" width="{{ .width | default "250" }}" alt="{{ .alt }}"></figure>
|
||||
{{ end -}}
|
11
themes/zen/layouts/partials/related.html
Normal file
11
themes/zen/layouts/partials/related.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<aside class="related layout__related">
|
||||
{{ $related := site.RegularPages.Related . | first 3 -}}
|
||||
{{ with $related -}}
|
||||
<h2>{{ i18n "string_see_also" }}</h2>
|
||||
<ul>
|
||||
{{ range . -}}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
{{ end -}}
|
||||
</aside>
|
60
themes/zen/layouts/partials/scripts.html
Normal file
60
themes/zen/layouts/partials/scripts.html
Normal file
|
@ -0,0 +1,60 @@
|
|||
{{ $opts := dict "minify" true -}}
|
||||
{{ if eq hugo.Environment "development" -}}
|
||||
{{ $opts = merge $opts (dict "minify" false) -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ $early := resources.Get "js/script-early.js" | js.Build $opts | fingerprint -}}
|
||||
<script src="{{ $early.RelPermalink }}"></script>
|
||||
|
||||
{{ if $.Param "alpine" -}}
|
||||
{{ $alpine := resources.Get "libs/alpine.min.js" | fingerprint -}}
|
||||
<script defer src="{{ $alpine.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Param "jquery" -}}
|
||||
{{ $jquery := resources.Get "libs/jquery.slim.min.js" | fingerprint -}}
|
||||
<script defer src="{{ $jquery.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Param "umbrella" -}}
|
||||
{{ $umbrella := resources.Get "libs/umbrella.min.js" | fingerprint -}}
|
||||
<script defer src="{{ $umbrella.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Param "mobilemenu" -}}
|
||||
{{ $mobilemenu := resources.Get "js/mobile.js" | js.Build $opts | fingerprint -}}
|
||||
<script defer src="{{ $mobilemenu.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Param "cookieconsent" -}}
|
||||
{{ $cookieconsent := resources.Get "js/cookieconsent.js" | js.Build $opts | fingerprint -}}
|
||||
<script defer src="{{ $cookieconsent.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Param "listsort" -}}
|
||||
{{ $listmin := resources.Get "libs/list.min.js" | fingerprint -}}
|
||||
<script defer src="{{ $listmin.RelPermalink }}"></script>
|
||||
{{ $listsort := resources.Get "js/listsort.js" | fingerprint -}}
|
||||
<script defer src="{{ $listsort.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if $.Param "tables" -}}
|
||||
{{ $tables := resources.Get "js/tables.js" | js.Build $opts | fingerprint -}}
|
||||
<script defer src="{{ $tables.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if .HasShortcode "contact" -}}
|
||||
{{ $contact := resources.Get "js/contact.js" | js.Build $opts | fingerprint -}}
|
||||
<script defer src="{{ $contact.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if .HasShortcode "search" -}}
|
||||
{{ $flexsearch := resources.Get "libs/flexsearch.compact.js" | fingerprint -}}
|
||||
<script defer src="{{ $flexsearch.RelPermalink }}"></script>
|
||||
{{ $search_opts := merge $opts (dict "params" (dict "searchLimit" (site.Params.searchLimit | default 20) "basePath" site.Home.RelPermalink)) -}}
|
||||
{{ $search := resources.Get "js/search.js" | js.Build $search_opts | fingerprint -}}
|
||||
<script defer src="{{ $search.RelPermalink }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ $script := resources.Get "js/script.js" | js.Build $opts | fingerprint -}}
|
||||
<script defer src="{{ $script.RelPermalink }}"></script>
|
15
themes/zen/layouts/partials/sidebar.html
Normal file
15
themes/zen/layouts/partials/sidebar.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{{ $currentSection := .Section -}}
|
||||
{{ $currentID := "" -}}
|
||||
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
|
||||
<aside class="sidebar layout__second-sidebar">
|
||||
{{ range site.Sections -}}
|
||||
<section class="menu">
|
||||
<p class="title"><strong><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></strong></p>
|
||||
<ul>
|
||||
{{ range .Pages -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</section>
|
||||
{{ end -}}
|
||||
</aside>
|
19
themes/zen/layouts/partials/styles.html
Normal file
19
themes/zen/layouts/partials/styles.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
{{ $main_options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" false "transpiler" (site.Params.sassTranspiler | default "libsass")) -}}
|
||||
{{ if eq hugo.Environment "development" -}}
|
||||
{{ $main_options = merge $main_options (dict "outputStyle" "nested" "enableSourceMap" true) -}}
|
||||
{{ end -}}
|
||||
{{ $mobile_options := merge $main_options (dict "targetPath" "css/mobile.css") -}}
|
||||
{{ $print_options := merge $main_options (dict "targetPath" "css/print.css") -}}
|
||||
{{ $main_style := resources.Get "sass/styles.scss" | toCSS $main_options -}}
|
||||
{{ $mobile_style := resources.Get "sass/mobile.scss" | toCSS $mobile_options -}}
|
||||
{{ $print_style := resources.Get "sass/print.scss" | toCSS $print_options -}}
|
||||
{{ if ne hugo.Environment "development" -}}
|
||||
{{ $main_style = $main_style | fingerprint -}}
|
||||
{{ $mobile_style = $mobile_style | fingerprint -}}
|
||||
{{ $print_style = $print_style | fingerprint -}}
|
||||
{{ end -}}
|
||||
{{ if $.Param "mobilemenu" -}}
|
||||
<link rel="stylesheet" href="{{ $mobile_style.RelPermalink }}" media="screen">
|
||||
{{ end -}}
|
||||
<link rel="stylesheet" href="{{ $main_style.RelPermalink }}">
|
||||
<link rel="stylesheet" href="{{ $print_style.RelPermalink }}" media="print">
|
3
themes/zen/layouts/partials/submitted.html
Normal file
3
themes/zen/layouts/partials/submitted.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div class="submitted meta">
|
||||
{{ partial "author-date" . }}
|
||||
</div>
|
8
themes/zen/layouts/partials/tags.html
Normal file
8
themes/zen/layouts/partials/tags.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<div class="tags meta">
|
||||
{{ i18n "taxo_tags" }}:
|
||||
<ul>
|
||||
{{ range (.GetTerms "tags") -}}
|
||||
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</div>
|
27
themes/zen/layouts/partials/tracking.html
Normal file
27
themes/zen/layouts/partials/tracking.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
{{ $gaid := (or site.Config.Services.GoogleAnalytics.ID site.GoogleAnalytics) -}}
|
||||
{{ $opts := dict
|
||||
"minify" true
|
||||
"params" (dict
|
||||
"cookieConsent" site.Params.cookieConsent
|
||||
"piwikTrackerUrl" site.Params.piwikTrackerUrl
|
||||
"piwikSiteID" site.Params.piwikSiteID
|
||||
"plausibleSiteID" site.Params.plausibleSiteID
|
||||
"GoogleAnalytics" $gaid) -}}
|
||||
{{ if eq hugo.Environment "development" -}}
|
||||
{{ $opts = merge $opts (dict "minify" false) -}}
|
||||
{{ end -}}
|
||||
{{ if and site.Params.piwikTrackerUrl site.Params.piwikSiteID -}}
|
||||
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
<script defer src="https://{{ site.Params.piwikTrackerUrl }}/matomo.js"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if site.Params.plausibleSiteID -}}
|
||||
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
|
||||
{{ end -}}
|
||||
|
||||
{{ if $gaid -}}
|
||||
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ end -}}
|
Loading…
Add table
Add a link
Reference in a new issue