Implement new layout dir structure.
This commit is contained in:
parent
c94e3a7022
commit
83530eb11a
52 changed files with 1 additions and 1 deletions
6
layouts/_markup/render-codeblock-math.html
Normal file
6
layouts/_markup/render-codeblock-math.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{{ .Page.Store.Set "math" true -}}
|
||||
<p{{ with .Attributes.class }} class="{{ . }}"{{ end }}>
|
||||
$$
|
||||
{{ .Inner }}
|
||||
$$
|
||||
</p>
|
||||
12
layouts/_markup/render-heading.html.example
Normal file
12
layouts/_markup/render-heading.html.example
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<div class="anchor">
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ range $k, $v := .Attributes }}{{ printf " %s=%q" $k $v | safeHTMLAttr }}{{ end }}>
|
||||
{{- .Text | safeHTML -}}
|
||||
</h{{ .Level }}>
|
||||
<a class="" href="#{{ .Anchor | safeURL }}" aria-label="{{ i18n "string_permalink" }}: {{ .Text | safeHTML }}">
|
||||
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||
<path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" />
|
||||
<path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" />
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
81
layouts/_markup/render-image.html.example
Normal file
81
layouts/_markup/render-image.html.example
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
{{/* Control how the image is rendered with these variables. */}}
|
||||
{{ $class := "" -}}
|
||||
{{ $size := "" -}}
|
||||
{{ $srcset := "" -}}
|
||||
{{ $width := "" -}}
|
||||
|
||||
{{/* Only change the below code if you know what you are doing. */}}
|
||||
{{ $height := "" -}}
|
||||
{{ $maxwidth := site.Params.imageMaxWidth -}}
|
||||
{{ $realwidth := 0 -}}
|
||||
{{ $realheight := 0 -}}
|
||||
{{ $resource := false -}}
|
||||
{{ $src := .Destination -}}
|
||||
{{ $srcsetw := (slice) -}}
|
||||
{{ $static := false -}}
|
||||
|
||||
{{ if and $src (fileExists (path.Join "/static" $src)) -}}
|
||||
{{ with (imageConfig (path.Join "/static" $src)) -}}
|
||||
{{ $realwidth = .Width -}}
|
||||
{{ $realheight = .Height -}}
|
||||
{{ end -}}
|
||||
{{ $static = true -}}
|
||||
{{ $src = relURL $src -}}
|
||||
{{ else if $src -}}
|
||||
{{ $src = strings.TrimLeft "/" $src -}}
|
||||
{{ with resources.Get $src -}}
|
||||
{{ $resource = . -}}
|
||||
{{ end -}}
|
||||
{{ with .Page.Resources.Get $src -}}
|
||||
{{ $resource = . -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if $resource -}}
|
||||
{{ if $size -}}
|
||||
{{ $image := $resource.Resize $size -}}
|
||||
{{ $src = $image.RelPermalink -}}
|
||||
{{ $width = $image.Width -}}
|
||||
{{ $height = $image.Height -}}
|
||||
{{ if $srcset -}}
|
||||
{{ $srcsetw = $srcsetw | append (printf "%s %sw" $src (strings.TrimRight "x" $size)) -}}
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ $src = $resource.RelPermalink -}}
|
||||
{{ $realwidth = $resource.Width -}}
|
||||
{{ $realheight = $resource.Height -}}
|
||||
{{ end -}}
|
||||
{{ if $srcset -}}
|
||||
{{ range $set := split $srcset " " -}}
|
||||
{{ $image := $resource.Resize (printf "%sx" $set) -}}
|
||||
{{ $srcsetw = $srcsetw | append (printf "%s %sw" $image.RelPermalink $set) -}}
|
||||
{{ end -}}
|
||||
{{ $width = "" -}}
|
||||
{{ $height = "" -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
{{ if and $width $height -}}
|
||||
{{ $width = int $width -}}
|
||||
{{ $height = int $height -}}
|
||||
{{ else if $width -}}
|
||||
{{ $width = int $width -}}
|
||||
{{ $height = $realheight -}}
|
||||
{{ if and ($realwidth) (lt ($width) ($realwidth)) -}}
|
||||
{{ $height = (mul ($realheight) (div (add ($width) 0.0) ($realwidth))) -}}
|
||||
{{ $height = (math.Round $height) -}}
|
||||
{{ end -}}
|
||||
{{ else if $height -}}
|
||||
{{ $width = $realwidth -}}
|
||||
{{ $height = int $height -}}
|
||||
{{ if and ($realheight) (lt ($height) ($realheight)) -}}
|
||||
{{ $width = (mul ($realwidth) (div (add ($height) 0.0) ($realheight))) -}}
|
||||
{{ $width = (math.Round $width) -}}
|
||||
{{ end -}}
|
||||
{{ else if and ($maxwidth) (lt ($maxwidth) ($realwidth)) -}}
|
||||
{{ $width = ($maxwidth) -}}
|
||||
{{ $height = (mul ($realheight) (div (add ($width) 0.0) ($realwidth))) -}}
|
||||
{{ $height = (math.Round $height) -}}
|
||||
{{ end -}}
|
||||
|
||||
<img class="image{{ with $class }} {{ . }}{{ end }}" src="{{ $src }}" alt="{{ .Text }}"{{ with $srcsetw }} srcset="{{ delimit . ", " }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}{{ with .Title}} title="{{ . }}"{{ end }}>
|
||||
1
layouts/_markup/render-link.html.example
Normal file
1
layouts/_markup/render-link.html.example
Normal file
|
|
@ -0,0 +1 @@
|
|||
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener noreferrer"{{ end }}>{{ .Text | safeHTML }}</a>
|
||||
3
layouts/_partials/author-date.html
Normal file
3
layouts/_partials/author-date.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{{ with .Params.author | default site.Params.author.name }}<span class="author" itemprop="author">{{ . }}</span>{{ end -}}
|
||||
{{ if and .Date (or .Params.author site.Params.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
layouts/_partials/cookieconsent.html
Normal file
10
layouts/_partials/cookieconsent.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<div class="cookieconsent layout__cookieconsent" hidden>
|
||||
<div class="cookieconsent__message">
|
||||
{{ i18n "cookieconsent_message" }}
|
||||
</div>
|
||||
<div class="cookieconsent__actions">
|
||||
<button class="button button--small button--decline" type="button" data-consent="false">{{ i18n "cookieconsent_decline" }}</button>
|
||||
<button class="button button--small button--accept" type="button" data-consent="true">{{ i18n "cookieconsent_accept" }}</button>
|
||||
{{ with site.Params.privacyPolicyUrl }}<a class="button button--small" href="{{ . }}">{{ i18n "privacy_policy" }}</a>{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
4
layouts/_partials/dates.html
Normal file
4
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>
|
||||
17
layouts/_partials/favicons.html
Normal file
17
layouts/_partials/favicons.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{{ if fileExists (path.Join "/static" "apple-touch-icon.png") -}}
|
||||
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}">
|
||||
{{ end -}}
|
||||
{{ if fileExists (path.Join "/static" "favicon.svg") -}}
|
||||
<link rel="icon" type="image/svg+xml" href="{{ "favicon.svg" | relURL }}">
|
||||
{{ end -}}
|
||||
{{ if fileExists (path.Join "/static" "site.webmanifest") -}}
|
||||
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}">
|
||||
{{ end -}}
|
||||
{{ $favname := "" -}}
|
||||
{{ $favsizes := slice "512x512" "256x256" "128x128" "96x96" "48x48" "32x32" "16x16" -}}
|
||||
{{ range $favsizes -}}
|
||||
{{ $favname = (printf "favicon-%s.png" .) -}}
|
||||
{{ if fileExists (path.Join "/static" $favname) -}}
|
||||
<link rel="icon" type="image/png" {{ printf "sizes=%q" . | safeHTMLAttr }} href="{{ $favname | relURL }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
8
layouts/_partials/feedlinks.html
Normal file
8
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
layouts/_partials/language-selector.html
Normal file
19
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="flex-inline mx--0">
|
||||
{{ if .IsTranslated -}}
|
||||
{{ range .Translations -}}
|
||||
<li><a rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Site.Language.LanguageCode | default .Lang }}" lang="{{ .Site.Language.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
layouts/_partials/math.html
Normal file
11
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 -}}
|
||||
8
layouts/_partials/menu.html
Normal file
8
layouts/_partials/menu.html
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<nav class="main-menu{{ if not ($.Param "menuinheader") }} mx--xs layout__navigation{{ end }}" aria-label="{{ i18n "menu_title" }}">
|
||||
<ul class="flex-inline mx--0">
|
||||
{{ $currentPage := . -}}
|
||||
{{ range site.Menus.main -}}
|
||||
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} aria-current="page"{{ end }}>{{ .Pre }}<span>{{ or (i18n .Identifier) .Name | safeHTML }}</span>{{ .Post }}</a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</nav>
|
||||
29
layouts/_partials/meta-breadcrumb-json-ld.html
Normal file
29
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) -}}
|
||||
60
layouts/_partials/meta-json-ld.html
Normal file
60
layouts/_partials/meta-json-ld.html
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<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 }},
|
||||
{{ if .IsHome -}}
|
||||
{{ with $.Param "description" }}"description": {{ . }},{{ end }}
|
||||
{{ else -}}
|
||||
{{ with .Description }}"description": {{ . }},{{ end }}
|
||||
{{ end -}}
|
||||
{{ with .Params.tags -}}
|
||||
"keywords": {{ delimit . " " }},
|
||||
{{ 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 .Params.author | default site.Params.author.name -}}
|
||||
"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>
|
||||
28
layouts/_partials/meta.html
Normal file
28
layouts/_partials/meta.html
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" {{ printf "type=%q" .MediaType.Type | safeHTMLAttr }} title="{{ .Name }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
{{ if .IsHome -}}
|
||||
{{ with $.Param "description" }}<meta name="description" content="{{ . }}">{{ end }}
|
||||
{{ else -}}
|
||||
{{ with .Description }}<meta name="description" content="{{ . }}">{{ end }}
|
||||
{{ 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 .Params.author | default site.Params.author.name }}<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.Language.LanguageCode | default .Lang }}" href="{{ .Permalink }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
22
layouts/_partials/mobilemenu.html
Normal file
22
layouts/_partials/mobilemenu.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<div class="mobile-nav" dir="ltr" hidden>
|
||||
<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 hugo.IsMultilingual }}{{ partial "language-selector.html" . }}{{ end }}</div>
|
||||
<nav class="mobile-nav__main-menu" aria-label="{{ i18n "menu_title" }}">
|
||||
<ul class="mobile-nav__navbar">
|
||||
{{ $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 -}}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
14
layouts/_partials/pagination-lite.html
Normal file
14
layouts/_partials/pagination-lite.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
layouts/_partials/podcast.html
Normal file
12
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
layouts/_partials/relatedposts.html
Normal file
11
layouts/_partials/relatedposts.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<aside class="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>
|
||||
13
layouts/_partials/repository-links.html
Normal file
13
layouts/_partials/repository-links.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{{ if .File -}}
|
||||
{{ with site.Params.repository -}}
|
||||
{{ $branch := .branch | default "main" -}}
|
||||
{{ $path := strings.TrimPrefix hugo.WorkingDir .File.Filename -}}
|
||||
{{ $edithref := printf .urlPatternEdit .owner .repo $branch $path | urls.JoinPath -}}
|
||||
{{ $viewhref := printf .urlPatternView .owner .repo $branch $path | urls.JoinPath -}}
|
||||
<div class="repository-links flex-inline meta">
|
||||
<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 92 92"><defs><clipPath id="a"><path d="M0 .113h91.887V92H0Zm0 0"/></clipPath></defs><g clip-path="url(#a)"><path style="stroke:none;fill-rule:nonzero;fill:#100f0d;fill-opacity:1" d="M90.156 41.965 50.036 1.848a5.913 5.913 0 0 0-8.368 0l-8.332 8.332 10.566 10.566a7.03 7.03 0 0 1 7.23 1.684 7.043 7.043 0 0 1 1.673 7.277l10.183 10.184a7.026 7.026 0 0 1 7.278 1.672 7.04 7.04 0 0 1 0 9.957 7.045 7.045 0 0 1-9.961 0 7.038 7.038 0 0 1-1.532-7.66l-9.5-9.497V59.36a7.04 7.04 0 0 1 1.86 11.29 7.04 7.04 0 0 1-9.957 0 7.04 7.04 0 0 1 0-9.958 7.034 7.034 0 0 1 2.308-1.539V33.926a7.001 7.001 0 0 1-2.308-1.535 7.049 7.049 0 0 1-1.516-7.7L29.242 14.273 1.734 41.777a5.918 5.918 0 0 0 0 8.371L41.855 90.27a5.92 5.92 0 0 0 8.368 0l39.933-39.934a5.925 5.925 0 0 0 0-8.371"/></g></svg>
|
||||
<a href="{{ $viewhref }}" rel="external">{{ i18n "string_view" }}</a>
|
||||
<a href="{{ $edithref }}" rel="external">{{ i18n "string_edit" }}</a>
|
||||
</div>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue