template installiert
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
{{- $description := .Summary -}}
|
||||
{{- if isset .Params "description" -}}
|
||||
{{- $description = .Params.description -}}
|
||||
{{- end -}}
|
||||
{{- $description = $description | plainify | htmlUnescape -}}
|
||||
{{- $limit := int (.Site.Params.cardDescriptionLength | default 0) -}}
|
||||
{{- if gt $limit 0 -}}
|
||||
{{- $description = $description | truncate $limit -}}
|
||||
{{- end -}}
|
||||
{{- return $description -}}
|
||||
@@ -0,0 +1,18 @@
|
||||
<footer class="site-footer side-padding">
|
||||
{{ $navigation := .Site.Params.navigation | default dict }}
|
||||
<p class="footer-brand">
|
||||
{{- if isset $.Site.Params "brand"}}{{ $.Site.Params.brand }}{{ else }}{{ $.Site.Title }}{{ end -}}
|
||||
</p>
|
||||
<nav class="footer-links" aria-label="Footer navigation">
|
||||
<a href="{{ $.Site.Home.RelPermalink }}">Home</a>
|
||||
{{ range where .Site.Pages "Params.displayinmenu" true -}}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{ end -}}
|
||||
{{ range $key, $value := .Site.Taxonomies.categories -}}
|
||||
{{ with $.Site.GetPage (printf "%s%s" "categories/" ($key | urlize)) }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{ partial "social-links.html" (dict "context" . "class" "footer-social-links" "includeRss" $navigation.rssinmenu) }}
|
||||
</footer>
|
||||
@@ -0,0 +1,61 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>{{ if not .IsHome }}{{with .Title }}{{ . }} · {{ end }}{{ end }}{{ .Site.Title }}</title>
|
||||
{{ $description := .Description | default .Site.Params.description }}
|
||||
{{ if eq .Kind "term" }}{{ $description = .Description | default (printf "Posts about %s by %s." .Title .Site.Title) }}{{ end }}
|
||||
<meta name="description" content="{{ $description | plainify | truncate 160 }}" />
|
||||
{{ with site.Params.author.name }}<meta name="author" content="{{ . }}" />{{ end }}
|
||||
{{ $canonical := .Permalink }}
|
||||
{{ if in (slice "home" "section" "taxonomy" "term") .Kind }}{{ $canonical = .Paginator.URL | absURL }}{{ end }}
|
||||
<link rel="canonical" href="{{ $canonical }}">
|
||||
{{ if (fileExists "static/apple-touch-icon.png") -}}
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ "/apple-touch-icon.png" | absURL }}">
|
||||
{{ end -}}
|
||||
{{ if (fileExists "static/favicon-32x32.png") -}}
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{ "/favicon-32x32.png" | absURL }}">
|
||||
{{ end -}}
|
||||
{{ if (fileExists "static/favicon-16x16.png") -}}
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ "/favicon-16x16.png" | absURL }}">
|
||||
{{ end -}}
|
||||
{{ if (fileExists "static/site.webmanifest") -}}
|
||||
<link rel="manifest" href="{{ "/site.webmanifest" | absURL }}">
|
||||
{{ end -}}
|
||||
{{ if (fileExists "static/safari-pinned-tab.svg") -}}
|
||||
<link rel="mask-icon" href="{{ "/safari-pinned-tab.svg" | absURL }}" color="{{ site.Params.appearance.maskIconColor | default "#22201d" }}">
|
||||
{{ end -}}
|
||||
{{ partial "opengraph.html" . }}
|
||||
{{ partial "twitter_cards.html" . }}
|
||||
{{ partial "structured-data.html" . }}
|
||||
{{ if (templates.Exists "_partials/meta-tags.html") -}}
|
||||
{{ partial "meta-tags.html" . }}
|
||||
{{ end -}}
|
||||
{{ with resources.Get "css/katex.min.css" -}}
|
||||
{{ $katexStyle := . | fingerprint }}
|
||||
<link href="{{ $katexStyle.RelPermalink }}" rel="stylesheet" integrity="{{ $katexStyle.Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end -}}
|
||||
<meta name="theme-color" content="#f7f3eb" media="(prefers-color-scheme: light)">
|
||||
<meta name="theme-color" content="#20201d" media="(prefers-color-scheme: dark)">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
{{ $normalizeStyle := resources.Get "css/normalize.css" }}
|
||||
{{ $fontStyle := resources.Get "css/source-sans-3.css" }}
|
||||
{{ $mainStyle := resources.Get "css/style.css" }}
|
||||
{{ $overrideStyle := resources.Get "css/override.css" }}
|
||||
{{ $style := slice $normalizeStyle $fontStyle $mainStyle $overrideStyle | resources.Concat "css/noesis.css" | minify | fingerprint }}
|
||||
<link href="{{ $style.RelPermalink }}" rel="stylesheet" integrity="{{ $style.Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
{{ partial "google_analytics.html" . }}
|
||||
{{ $appearance := .Site.Params.appearance | default dict }}
|
||||
{{ with $appearance.backgroundimage -}}
|
||||
{{ with resources.GetMatch . -}}
|
||||
<style>
|
||||
body {
|
||||
background: #ecedef url("{{ .RelPermalink | safeCSS }}") repeat;
|
||||
}
|
||||
</style>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</head>
|
||||
@@ -0,0 +1,3 @@
|
||||
{{ with .Site.Params.metaCreator -}}
|
||||
<meta name="twitter:creator" content="{{ . }}">
|
||||
{{ end -}}
|
||||
@@ -0,0 +1,51 @@
|
||||
<nav class="nav-bar side-padding" aria-label="Primary navigation">
|
||||
{{ $socials := .Site.Params.socials | default dict }}
|
||||
{{ $navigation := .Site.Params.navigation | default dict }}
|
||||
<p class="nav-header"><a href="{{ .Site.Home.RelPermalink }}" class="nav-text">
|
||||
{{- if isset $.Site.Params "brand"}}
|
||||
{{- $.Site.Params.brand -}}
|
||||
{{ else }}
|
||||
{{- $.Site.Title -}}
|
||||
{{ end -}}
|
||||
</a></p>
|
||||
<ul class="nav-links">
|
||||
<li><a href="{{ .Site.Home.RelPermalink }}"{{ if .IsHome }} aria-current="page"{{ end }}>Home</a></li>
|
||||
{{ range where .Site.Pages "Params.displayinmenu" true -}}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq .RelPermalink $.RelPermalink }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
{{ range $key, $value := .Site.Taxonomies.categories -}}
|
||||
{{ with $.Site.GetPage (printf "%s%s" "categories/" ($key | urlize)) }}
|
||||
<li><a href="{{ .RelPermalink }}"{{ if eq .RelPermalink $.RelPermalink }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{ if eq $navigation.rssinmenu true -}}
|
||||
<li><a href="{{ "/index.xml" | relURL }}">rss</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
<div class="hamburger-menu">
|
||||
<input class="hamburger-menu-button" type="checkbox"
|
||||
onclick="hamburgerMenuPressed.call(this)"
|
||||
aria-label="Open navigation menu"
|
||||
aria-expanded="false"
|
||||
aria-controls="menu"
|
||||
>
|
||||
<div class="hamburger-menu-icon" aria-hidden="true">
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
<ul id="menu" class="hamburger-menu-overlay">
|
||||
<li><a href="{{ .Site.Home.RelPermalink }}" class="hamburger-menu-overlay-link"{{ if .IsHome }} aria-current="page"{{ end }}>Home</a></li>
|
||||
{{ range where .Site.Pages "Params.displayinmenu" true -}}
|
||||
<li><a href="{{ .RelPermalink }}" class="hamburger-menu-overlay-link"{{ if eq .RelPermalink $.RelPermalink }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end -}}
|
||||
{{ range $key, $value := .Site.Taxonomies.categories -}}
|
||||
{{ with $.Site.GetPage (printf "%s%s" "categories/" ($key | urlize)) }}
|
||||
<li><a href="{{ .RelPermalink }}" class="hamburger-menu-overlay-link"{{ if eq .RelPermalink $.RelPermalink }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{ if eq $navigation.rssinmenu true -}}
|
||||
<li><a href="{{ "/index.xml" | relURL }}" class="hamburger-menu-overlay-link">rss</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
@@ -0,0 +1,39 @@
|
||||
{{- $image := .image -}}
|
||||
{{- $alt := .alt | default "" -}}
|
||||
{{- $class := .class | default "" -}}
|
||||
{{- $pictureClass := .pictureClass | default "" -}}
|
||||
{{- $sizes := .sizes | default "100vw" -}}
|
||||
{{- $style := .style | default "" -}}
|
||||
{{- $title := .title | default "" -}}
|
||||
{{- $loading := .loading | default "lazy" -}}
|
||||
{{- $widths := .widths | default (slice 711 1422 2133) -}}
|
||||
{{- $images := slice -}}
|
||||
{{- if and $image (reflect.IsImageResourceProcessable $image) -}}
|
||||
{{- range $widths -}}
|
||||
{{- $width := int . -}}
|
||||
{{- if le $width $image.Width -}}
|
||||
{{- $images = $images | append ($image.Resize (printf "%dx Lanczos" $width)) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if eq (len $images) 0 -}}
|
||||
{{- $images = $images | append $image -}}
|
||||
{{- end -}}
|
||||
{{- $fallback := index $images 0 -}}
|
||||
<picture{{ with $pictureClass }} class="{{ . }}"{{ end }}>
|
||||
{{- $webpImages := slice -}}
|
||||
{{- range $images -}}
|
||||
{{- $webpImages = $webpImages | append (.Resize (printf "%dx webp Lanczos" .Width)) -}}
|
||||
{{- end }}
|
||||
<source type="image/webp" srcset="{{ range $index, $candidate := $webpImages }}{{ if $index }}, {{ end }}{{ $candidate.RelPermalink }} {{ $candidate.Width }}w{{ end }}" sizes="{{ $sizes }}">
|
||||
<source srcset="{{ range $index, $candidate := $images }}{{ if $index }}, {{ end }}{{ $candidate.RelPermalink }} {{ $candidate.Width }}w{{ end }}" sizes="{{ $sizes }}">
|
||||
<img src="{{ $fallback.RelPermalink }}" width="{{ $fallback.Width }}" height="{{ $fallback.Height }}"{{ with $class }} class="{{ . }}"{{ end }} alt="{{ $alt }}" loading="{{ $loading }}" decoding="async"{{ with $title }} title="{{ . }}"{{ end }}{{ with $style }} style="{{ . | safeCSS }}"{{ end }}>
|
||||
</picture>
|
||||
{{- else if and $image (reflect.IsImageResourceWithMeta $image) -}}
|
||||
<picture{{ with $pictureClass }} class="{{ . }}"{{ end }}>
|
||||
<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}"{{ with $class }} class="{{ . }}"{{ end }} alt="{{ $alt }}" loading="{{ $loading }}" decoding="async"{{ with $title }} title="{{ . }}"{{ end }}{{ with $style }} style="{{ . | safeCSS }}"{{ end }}>
|
||||
</picture>
|
||||
{{- else if $image -}}
|
||||
<picture{{ with $pictureClass }} class="{{ . }}"{{ end }}>
|
||||
<img src="{{ $image.RelPermalink }}"{{ with $class }} class="{{ . }}"{{ end }} alt="{{ $alt }}" loading="{{ $loading }}" decoding="async"{{ with $title }} title="{{ . }}"{{ end }}{{ with $style }} style="{{ . | safeCSS }}"{{ end }}>
|
||||
</picture>
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,10 @@
|
||||
{{ with resources.Get "js/katex.min.js" }}
|
||||
{{ $katex := . | fingerprint }}
|
||||
<script defer src="{{ $katex.RelPermalink }}" integrity="{{ $katex.Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{ end }}
|
||||
{{ with resources.Get "js/contrib/auto-render.min.js" }}
|
||||
{{ $autoRender := . | fingerprint }}
|
||||
<script defer src="{{ $autoRender.RelPermalink }}" integrity="{{ $autoRender.Data.Integrity }}" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
|
||||
{{ end }}
|
||||
{{ $corejs := resources.Get "js/core.js" | minify | fingerprint }}
|
||||
<script defer src="{{ $corejs.RelPermalink }}" integrity="{{ $corejs.Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
@@ -0,0 +1,74 @@
|
||||
{{- $ctx := .context -}}
|
||||
{{- $class := .class | default "social-links" -}}
|
||||
{{- $includeRss := .includeRss | default false -}}
|
||||
{{- $socials := $ctx.Site.Params.socials | default dict -}}
|
||||
{{- $fallbackIcon := resources.Get "icons/link.svg" -}}
|
||||
{{- $services := slice
|
||||
(dict "key" "email" "label" "Email" "icon" "email")
|
||||
(dict "key" "discord" "label" "Discord" "icon" "discord")
|
||||
(dict "key" "facebook" "label" "Facebook" "icon" "facebook")
|
||||
(dict "key" "flickr" "label" "Flickr" "icon" "flickr")
|
||||
(dict "key" "github" "label" "GitHub" "icon" "github")
|
||||
(dict "key" "instagram" "label" "Instagram" "icon" "instagram")
|
||||
(dict "key" "linkedin" "label" "LinkedIn" "icon" "linkedin")
|
||||
(dict "key" "patreon" "label" "Patreon" "icon" "patreon")
|
||||
(dict "key" "pinterest" "label" "Pinterest" "icon" "pinterest")
|
||||
(dict "key" "reddit" "label" "Reddit" "icon" "reddit")
|
||||
(dict "key" "snapchat" "label" "Snapchat" "icon" "snapchat")
|
||||
(dict "key" "soundcloud" "label" "SoundCloud" "icon" "soundcloud")
|
||||
(dict "key" "spotify" "label" "Spotify" "icon" "spotify")
|
||||
(dict "key" "tiktok" "label" "TikTok" "icon" "tik-tok")
|
||||
(dict "key" "tumblr" "label" "Tumblr" "icon" "tumblr")
|
||||
(dict "key" "twitch" "label" "Twitch" "icon" "twitch")
|
||||
(dict "key" "x" "label" "X" "icon" "twitter-alt")
|
||||
(dict "key" "twitter" "label" "X" "icon" "twitter-alt")
|
||||
(dict "key" "vimeo" "label" "Vimeo" "icon" "vimeo")
|
||||
(dict "key" "whatsapp" "label" "WhatsApp" "icon" "whatsapp")
|
||||
(dict "key" "youtube" "label" "YouTube" "icon" "youtube")
|
||||
-}}
|
||||
<div class="social-links {{ $class }}">
|
||||
{{- range $services -}}
|
||||
{{- $key := .key -}}
|
||||
{{- $label := .label -}}
|
||||
{{- if isset $socials $key -}}
|
||||
{{- $raw := index $socials $key -}}
|
||||
{{- if $raw -}}
|
||||
{{- $href := printf "%s" $raw -}}
|
||||
{{- if and (eq $key "email") (not (strings.HasPrefix $href "mailto:")) -}}
|
||||
{{- $href = printf "mailto:%s" $href -}}
|
||||
{{- end -}}
|
||||
{{- $iconName := .icon -}}
|
||||
{{- $icon := resources.Get (printf "icons/%s.svg" $iconName) -}}
|
||||
{{- if not $icon -}}
|
||||
{{- $icon = $fallbackIcon -}}
|
||||
{{- end -}}
|
||||
{{- $darkIcon := resources.Get (printf "icons/%s-dark.svg" $iconName) -}}
|
||||
{{- if not $darkIcon -}}
|
||||
{{- $darkIcon = $icon -}}
|
||||
{{- end -}}
|
||||
{{- with $icon -}}
|
||||
<a href="{{ $href }}"{{ if ne $key "email" }} target="_blank" rel="noopener noreferrer"{{ end }} aria-label="{{ $label }}" title="{{ $label }}" style="{{ printf "--social-icon: url('%s'); --social-icon-dark: url('%s');" .RelPermalink $darkIcon.RelPermalink | safeCSS }}">
|
||||
<span class="social-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">{{ $label }}</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $includeRss -}}
|
||||
{{- $rssIcon := resources.Get "icons/rss.svg" -}}
|
||||
{{- if not $rssIcon -}}
|
||||
{{- $rssIcon = $fallbackIcon -}}
|
||||
{{- end -}}
|
||||
{{- $rssDarkIcon := resources.Get "icons/rss-dark.svg" -}}
|
||||
{{- if not $rssDarkIcon -}}
|
||||
{{- $rssDarkIcon = $rssIcon -}}
|
||||
{{- end -}}
|
||||
{{- with $rssIcon -}}
|
||||
<a href="{{ "/index.xml" | relURL }}" target="_blank" rel="noopener noreferrer" aria-label="RSS" title="RSS" style="{{ printf "--social-icon: url('%s'); --social-icon-dark: url('%s');" .RelPermalink $rssDarkIcon.RelPermalink | safeCSS }}">
|
||||
<span class="social-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">RSS</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
@@ -0,0 +1,59 @@
|
||||
{{- $author := site.Params.author | default dict -}}
|
||||
{{- $profile := site.Home.Params.profile | default dict -}}
|
||||
{{- with or $author.name $profile.name -}}
|
||||
{{- $personID := printf "%s#person" site.Home.Permalink -}}
|
||||
{{- $person := dict "@type" "Person" "@id" $personID "name" . "url" site.Home.Permalink -}}
|
||||
{{- with or $author.jobtitle $profile.jobtitle -}}
|
||||
{{- $person = merge $person (dict "jobTitle" .) -}}
|
||||
{{- end -}}
|
||||
{{- with $author.worksfor -}}
|
||||
{{- $person = merge $person (dict "worksFor" (dict "@type" "Organization" "name" .)) -}}
|
||||
{{- end -}}
|
||||
{{- with or $author.location $profile.location -}}
|
||||
{{- $person = merge $person (dict "homeLocation" (dict "@type" "Place" "name" .)) -}}
|
||||
{{- end -}}
|
||||
{{- with $profile.headshotimage -}}
|
||||
{{- with or (site.Home.Resources.GetMatch .) (resources.GetMatch .) -}}
|
||||
{{- $person = merge $person (dict "image" .Permalink) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $sameAs := slice -}}
|
||||
{{- range $key, $url := site.Params.socials | default dict -}}
|
||||
{{- if and $url (ne $key "email") -}}
|
||||
{{- $sameAs = $sameAs | append $url -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- with $sameAs -}}
|
||||
{{- $person = merge $person (dict "sameAs" .) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $authorRef := dict "@id" $personID -}}
|
||||
{{- $description := $.Description | default site.Params.description | plainify -}}
|
||||
{{- $graph := slice $person -}}
|
||||
|
||||
{{- if $.IsHome -}}
|
||||
{{- $website := dict "@type" "WebSite" "@id" (printf "%s#website" site.Home.Permalink) "name" site.Title "url" site.Home.Permalink "inLanguage" site.Language.Locale "author" $authorRef "publisher" $authorRef -}}
|
||||
{{- with $description }}{{ $website = merge $website (dict "description" .) }}{{ end -}}
|
||||
{{- $graph = $graph | append $website -}}
|
||||
{{- else if $.IsPage -}}
|
||||
{{- $type := $.Params.schematype | default (cond $.Date.IsZero "WebPage" "BlogPosting") -}}
|
||||
{{- $page := dict "@type" $type "@id" $.Permalink "url" $.Permalink "name" ($.Title | plainify) "inLanguage" site.Language.Locale "isPartOf" (dict "@id" (printf "%s#website" site.Home.Permalink)) -}}
|
||||
{{- with $description }}{{ $page = merge $page (dict "description" .) }}{{ end -}}
|
||||
{{- if eq $type "ProfilePage" -}}
|
||||
{{- $page = merge $page (dict "mainEntity" $authorRef) -}}
|
||||
{{- else if eq $type "BlogPosting" -}}
|
||||
{{- $page = merge $page (dict
|
||||
"headline" ($.Title | plainify)
|
||||
"mainEntityOfPage" $.Permalink
|
||||
"datePublished" ($.Date.Format "2006-01-02T15:04:05Z07:00")
|
||||
"dateModified" ($.Lastmod.Format "2006-01-02T15:04:05Z07:00")
|
||||
"author" $authorRef
|
||||
"publisher" $authorRef
|
||||
) -}}
|
||||
{{- with $.Params.categories }}{{ $page = merge $page (dict "articleSection" .) }}{{ end -}}
|
||||
{{- with $.Resources.GetMatch "featuredImage" }}{{ $page = merge $page (dict "image" .Permalink) }}{{ end -}}
|
||||
{{- end -}}
|
||||
{{- $graph = $graph | append $page -}}
|
||||
{{- end }}
|
||||
<script type="application/ld+json">{{ dict "@context" "https://schema.org" "@graph" $graph | jsonify | safeJS }}</script>
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user