update theme

This commit is contained in:
Christoph Cullmann 2025-07-18 21:45:32 +02:00
parent fc43dba964
commit 93fea0ed81
No known key found for this signature in database
183 changed files with 6015 additions and 6241 deletions

View file

@ -1,12 +1,10 @@
{{ $strAnchor := urlize .Anchor }}
{{ $replacedAnchor := replaceRE "%25" "" $strAnchor }}
{{ $anchor := anchorize .Anchor }}
<h{{ .Level }} class="relative group">{{ .Text | safeHTML }}
<div id="{{ .Anchor | safeURL | urlize }}" class="anchor"></div>
{{ if.Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}
<div id="{{ $anchor }}" class="anchor"></div>
{{ if .Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#{{ $replacedAnchor | safeURL }}" aria-label="{{ i18n "article.anchor_label" }}">#</a>
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#{{ $anchor }}" aria-label="{{ i18n "article.anchor_label" }}">#</a>
</span>
{{ end }}
</h{{ .Level }}>

View file

@ -1,48 +1,55 @@
{{- $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ define "RenderImageSimple" -}}
<img class="my-0 rounded-md" loading="lazy" alt="{{ .alt }}" src="{{ .src }}">
{{- end }}
{{ define "RenderImageResponsive" -}}
<img
class="my-0 rounded-md"
loading="lazy"
decoding="async"
fetchpriority="low"
alt="{{ .alt }}"
srcset="
{{ (.resource.Resize "330x").RelPermalink }} 330w,
{{ (.resource.Resize "660x").RelPermalink }} 660w,
{{ (.resource.Resize "1280x").RelPermalink }} 1280w
"
data-zoom-src="{{ .resource.RelPermalink }}"
src="{{ .resource.RelPermalink }}">
{{- end }}
{{ define "RenderImageCaption" -}}
{{- with .caption }}
<figcaption>{{ . | markdownify }}</figcaption>
{{- end }}
{{- end }}
{{- $disableImageOptimizationMD := .Page.Site.Params.disableImageOptimizationMD | default false }}
{{- $url := urls.Parse .Destination }}
{{- $altText := .Text }}
{{- $caption := .Title }}
{{- if findRE "^https?" $url.Scheme }}
<figure>
<img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" />
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{- else }}
{{- $resource := "" }}
{{- if $.Page.Resources.GetMatch ($url.String) }}
{{- $resource = $.Page.Resources.GetMatch ($url.String) }}
{{- else if resources.GetMatch ($url.String) }}
{{- $resource = resources.Get ($url.String) }}
{{- end }}
{{- with $resource }}
<figure>
{{- if or $disableImageOptimization (eq .MediaType.SubType "svg")}}
<img
class="my-0 rounded-md"
loading="lazy"
src="{{ .RelPermalink }}"
alt="{{ $altText }}"
/>
{{- else }}
<img
class="my-0 rounded-md"
loading="lazy"
srcset="
{{ (.Resize "330x").RelPermalink }} 330w,
{{ (.Resize "660x").RelPermalink }} 660w,
{{ (.Resize "1024x").RelPermalink }} 1024w,
{{ (.Resize "1320x").RelPermalink }} 2x"
data-zoom-src="{{ (.Resize "1320x").RelPermalink }}"
src="{{ (.Resize "660x").RelPermalink }}"
alt="{{ $altText }}"
/>
{{- end }}
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{- else }}
<figure>
<img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" />
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
</figure>
{{- end }}
{{- $isRemote := findRE "^https?" $url.Scheme }}
{{- $resource := "" }}
{{- if not $isRemote }}
{{- $resource = or ($.Page.Resources.GetMatch $url.String) (resources.Get $url.String) }}
{{- end }}
<figure>
{{- if $isRemote }}
{{ template "RenderImageSimple" (dict "src" $url.String "alt" $altText) }}
{{- else if $resource }}
{{- $isSVG := eq $resource.MediaType.SubType "svg" }}
{{- $shouldOptimize := and (not $disableImageOptimizationMD) (not $isSVG) }}
{{- if $shouldOptimize }}
{{ template "RenderImageResponsive" (dict "resource" $resource "alt" $altText) }}
{{- else }}
{{ template "RenderImageSimple" (dict "src" $resource.RelPermalink "alt" $altText) }}
{{- end }}
{{- else }}
{{ template "RenderImageSimple" (dict "src" $url.String "alt" $altText) }}
{{- end }}
{{ template "RenderImageCaption" (dict "caption" $caption) }}
</figure>

View file

@ -1,7 +1,11 @@
<a href="{{ .Destination | safeURL }}"
{{- with .Title -}}
<a
href="{{ .Destination | safeURL }}"
{{- with .Title -}}
title="{{ . }}"
{{- end }}
{{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}>
{{- .Text | safeHTML -}}
</a>
{{- end }}
{{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }}
target="_blank"
{{ end }}>
{{- .Text | safeHTML -}}
</a>
{{- /* Trim EOF */ -}}

View file

@ -1,42 +1,58 @@
<!DOCTYPE html>
<html lang="{{ with .Site.Params.isoCode | default (.Site.LanguageCode | default " en") }} {{- . -}} {{ end }}" dir="{{ if .Site.Params.rtl | default false -}}
<!doctype html>
<html
lang="{{ with .Site.Params.isoCode | default (.Site.LanguageCode | default " en") }}{{- . -}}{{ end }}"
dir="{{ if .Site.Params.rtl | default false -}}
rtl
{{- else -}}
ltr
{{- end }}" class="scroll-smooth" data-default-appearance="{{ .Site.Params.defaultAppearance | default " light" }}"
{{- end }}"
class="scroll-smooth"
data-default-appearance="{{ .Site.Params.defaultAppearance | default " light" }}"
data-auto-appearance="{{ .Site.Params.autoSwitchAppearance | default " true" }}">
{{- partial "head.html" . -}}
{{- partial "head.html" . -}}
<body
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32 scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600">
<div id="the-top" class="absolute flex self-center">
<a class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"
href="#main-content"><span
class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400">&darr;</span>{{ i18n
"nav.skip_to_main" }}</a>
</div>
{{ $header := print "header/" .Site.Params.header.layout ".html" }}
{{ if templates.Exists ( printf "partials/%s" $header ) }}
{{ partial $header . }}
{{ else }}
{{ partial "header/basic.html" . }}
{{ end }}
<div class="relative flex flex-col grow">
<main id="main-content" class="grow">
{{ block "main" . }}{{ end }}
{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }}
{{- partial "scroll-to-top.html" . -}}
{{ end }}
</main>
{{- partial "footer.html" . -}}
{{ if .Site.Params.enableSearch | default false }}
{{- partial "search.html" . -}}
<body
class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32 scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600">
<div id="the-top" class="absolute flex self-center">
<a
class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600"
href="#main-content"
><span class="font-bold text-primary-600 ltr:pr-2 rtl:pl-2 dark:text-primary-400">&darr;</span>{{ i18n
"nav.skip_to_main"
}}</a
>
</div>
{{ $header := print "header/" .Site.Params.header.layout ".html" }}
{{ if templates.Exists ( printf "partials/%s" $header ) }}
{{ partial $header . }}
{{ else }}
{{ partial "header/basic.html" . }}
{{ end }}
</div>
</body>
{{ if .Site.Params.buymeacoffee.globalWidget | default false }}
<script data-name="BMC-Widget" data-cfasync="false" src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"
data-id="{{ .Site.Params.buymeacoffee.identifier }}" data-description="Support me on Buy me a coffee!" data-message="{{ .Site.Params.buymeacoffee.globalWidgetMessage | default "" }}"
data-color="{{ .Site.Params.buymeacoffee.globalWidgetColor | default "#FFDD00" }}" data-position="{{ .Site.Params.buymeacoffee.globalWidgetPosition | default "Left" }}" data-x_margin="18" data-y_margin="18"></script>
{{ end }}
<div class="relative flex flex-col grow">
<main id="main-content" class="grow">
{{ block "main" . }}{{ end }}
{{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }}
{{- partial "scroll-to-top.html" . -}}
{{ end }}
</main>
{{- partial "footer.html" . -}}
{{ if .Site.Params.enableSearch | default false }}
{{- partial "search.html" . -}}
{{ end }}
</div>
</body>
{{ if .Site.Params.buymeacoffee.globalWidget | default false }}
<script
data-name="BMC-Widget"
data-cfasync="false"
src="https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"
data-id="{{ .Site.Params.buymeacoffee.identifier }}"
data-description="Support me on Buy me a coffee!"
data-message="{{ .Site.Params.buymeacoffee.globalWidgetMessage | default "" }}"
data-color="{{ .Site.Params.buymeacoffee.globalWidgetColor | default "#FFDD00" }}"
data-position="{{ .Site.Params.buymeacoffee.globalWidgetPosition | default "Left" }}"
data-x_margin="18"
data-y_margin="18"></script>
{{ end }}
</html>

View file

@ -26,13 +26,9 @@
{{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }}
{{end}}
<script>
var oid = "views_{{ $path }}"
var oid_likes = "likes_{{ $path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}" data-oid="views_{{ $path }}" data-oid-likes="likes_{{ $path }}"></script>
{{ end }}
</header>
<section class="{{ if $toc -}}
@ -91,7 +87,7 @@
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $cardViewScreenWidth }}
<div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);">
<div class="relative w-screen max-w-[1600px] px-[30px] left-[calc(max(-50vw,-800px)+50%)]">
{{ end }}
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
@ -107,7 +103,7 @@
{{ else }}
{{ if $cardViewScreenWidth }}
<div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);">
<div class="relative w-screen max-w-[1600px] px-[30px] left-[calc(max(-50vw,-800px)+50%)]">
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ else }}
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">

View file

@ -1,108 +1,124 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "single" }}
{{ .Scratch.Set "scope" "single" }}
<article>
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
{{ $heroStyle := .Params.heroStyle }}
{{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }}
{{ $heroStyle := print "hero/" $heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{ end }}
<header id="single_header" class="mt-5 max-w-prose">
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ .Title | emojify }}
</h1>
<div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }}
</div>
{{ $authorsData := .Site.Data.authors }}
{{ $taxonomies := .Site.Taxonomies.authors }}
{{ $baseURL := .Site.BaseURL }}
{{ $taxonomyLink := 0 }}
{{ $showAuthor := 0 }}
{{ if not (strings.HasSuffix $baseURL "/") }}
{{ $baseURL = delimit (slice $baseURL "/") "" }}
<article>
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
{{ $heroStyle := .Params.heroStyle }}
{{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }}
{{ $heroStyle := print "hero/" $heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{ end }}
{{ if not (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }}
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
{{ $showAuthor = 1 }}
{{ partial "author.html" . }}
<header id="single_header" class="mt-5 max-w-prose">
{{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
{{ range $author := .Page.Params.authors }}
{{ $authorData := index $authorsData $author }}
{{- if $authorData -}}
{{ range $taxonomyname, $taxonomy := $taxonomies }}
{{ if (eq $taxonomyname $author) }}
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }}
{{ end }}
{{ end }}
{{ $finalLink := $taxonomyLink }}
{{ $currentLang := $.Site.Language.Lang }}
{{ if eq $.Site.LanguagePrefix "" }}
{{ $finalLink = printf "%sauthors/%s/" $baseURL $author }}
{{ else }}
{{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }}
{{ end }}
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }}
{{- end -}}
{{ end }}
{{ if or $taxonomyLink $showAuthor }}
<div class="mb-5"></div>
{{ end }}
{{ end }}
</header>
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
{{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul")) (.Site.Params.article.showRelatedPosts | default false) }} <div
class="order-first lg:ml-auto px-0 lg:order-last ltr:lg:pl-8 rtl:lg:pr-8">
<div class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky {{ if hasPrefix .Site.Params.header.layout "fixed" -}}
lg:top-[140px]{{ else }}lg:top-10{{ end }}">
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul") }} {{ partial "toc.html" . }} {{ end }} {{ if .Site.Params.article.showRelatedPosts |
default false }} sd {{ end }} </div>
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ .Title | emojify }}
</h1>
<div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }}
</div>
{{ $authorsData := .Site.Data.authors }}
{{ $taxonomies := .Site.Taxonomies.authors }}
{{ $baseURL := .Site.BaseURL }}
{{ $taxonomyLink := 0 }}
{{ $showAuthor := 0 }}
{{ if not (strings.HasSuffix $baseURL "/") }}
{{ $baseURL = delimit (slice $baseURL "/") "" }}
{{ end }}
{{ if not (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }}
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
{{ $showAuthor = 1 }}
{{ partial "author.html" . }}
{{ end }}
{{ range $author := .Page.Params.authors }}
{{ $authorData := index $authorsData $author }}
{{- if $authorData -}}
{{ range $taxonomyname, $taxonomy := $taxonomies }}
{{ if (eq $taxonomyname $author) }}
{{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }}
{{ end }}
{{ end }}
{{ $finalLink := $taxonomyLink }}
{{ $currentLang := $.Site.Language.Lang }}
{{ if eq $.Site.LanguagePrefix "" }}
{{ $finalLink = printf "%sauthors/%s/" $baseURL $author }}
{{ else }}
{{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }}
{{ end }}
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }}
{{- end -}}
{{ end }}
{{ if or $taxonomyLink $showAuthor }}
<div class="mb-5"></div>
{{ end }}
{{ end }}
</header>
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
{{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul")) (.Site.Params.article.showRelatedPosts | default false)
}}
<div class="order-first lg:ml-auto px-0 lg:order-last ltr:lg:pl-8 rtl:lg:pr-8">
<div
class="toc ltr:pl-5 rtl:pr-5 print:hidden lg:sticky {{ if hasPrefix .Site.Params.header.layout "fixed" -}}
lg:top-[140px]
{{ else }}
lg:top-10
{{ end }}
">
{{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
.TableOfContents "<ul")
}}
{{ partial "toc.html" . }}
{{ end }}
{{ if .Site.Params.article.showRelatedPosts |
default false
}}
sd
{{ end }}
</div>
</div>
{{ end }}
<div class="min-w-0 min-h-0 max-w-fit">
{{ partial "series/series.html" . }}
<div class="article-content max-w-prose mb-20">
{{ .Content }}
{{ $defaultReplyByEmail := .Site.Params.replyByEmail }}
{{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }}
{{ if $replyByEmail }}
<strong class="block mt-8">
<a target="_blank"
class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
href="mailto:{{ .Site.Params.Author.email }}?subject={{ replace (printf "Reply to %s" .Title) "\"" "'" }}">
<a
target="_blank"
class="m-1 rounded bg-neutral-300 p-1.5 text-neutral-700 hover:bg-primary-500 hover:text-neutral dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-primary-400 dark:hover:text-neutral-800"
href="mailto:{{ .Site.Params.Author.email }}?subject={{ replace (printf "Reply to %s" .Title) "\"" "'" }}">
Reply by Email
</a>
</strong>
{{ end }}
</div>
{{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }}
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
@ -123,48 +139,48 @@
{{ end }}
{{ if or $taxonomyLink $showAuthor }}
<div class="mb-10"></div>
<div class="mb-10"></div>
{{ end }}
{{ end }}
{{ partial "series/series-closed.html" . }}
{{ partial "sharing-links.html" . }}
{{ partial "related.html" . }}
{{ partial "related.html" . }}
</div>
{{ $translations := .AllTranslations }}
{{ with .File }}
{{ $path := .Path }}
{{range $translations}}
{{ range $translations }}
{{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }}
{{end}}
<script>
var oid = "views_{{ $path }}"
var oid_likes = "likes_{{ $path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ end }}
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $jsPage.RelPermalink }}"
integrity="{{ $jsPage.Data.Integrity }}"
data-oid="views_{{ $path }}"
data-oid-likes="likes_{{ $path }}"></script>
{{ end }}
</section>
<footer class="pt-8 max-w-prose print:hidden">
{{ partial "article-pagination.html" . }}
{{ if .Params.showComments | default (.Site.Params.article.showComments | default false) }}
{{ if templates.Exists "partials/comments.html" }}
<div class="pt-3">
<hr class="border-dotted border-neutral-300 dark:border-neutral-600" />
<div class="pt-3">
{{ partial "comments.html" . }}
</div>
</div>
{{ else }}
{{ warnf "[BLOWFISH] Comments are enabled for %s but no comments partial exists." .File.Path }}
{{ end }}
{{ end }}
</footer>
</article>
</section>
<footer class="pt-8 max-w-prose print:hidden">
{{ partial "article-pagination.html" . }}
{{ if .Params.showComments | default (.Site.Params.article.showComments | default false) }}
{{ if templates.Exists "partials/comments.html" }}
<div class="pt-3">
<hr class="border-dotted border-neutral-300 dark:border-neutral-600">
<div class="pt-3">
{{ partial "comments.html" . }}
</div>
</div>
{{ else }}
{{ warnf "[BLOWFISH] Comments are enabled for %s but no comments partial exists." .File.Path }}
{{ end }}
{{ end }}
</footer>
</article>
{{ end }}

View file

@ -1,131 +1,128 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "term" }}
{{ if .Site.Params.term.showHero | default false }}
{{ $heroStyle := print "hero/" .Site.Params.term.heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ .Scratch.Set "scope" "term" }}
{{ if .Site.Params.term.showHero | default false }}
{{ $heroStyle := print "hero/" .Site.Params.term.heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.term.showTableOfContents | default false)) (in
.TableOfContents "<ul") }} <header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.term.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/term.html" (dict "context" . "scope" "single") }}
</div>
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.term.showTableOfContents | default false)) (in
.TableOfContents "<ul")
}}
<header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.term.showBreadcrumbs | default false) }}
{{ partial "breadcrumbs.html" . }}
{{ end }}
<h1 class="mt-5 text-4xl font-extrabold text-neutral-900 dark:text-neutral">{{ .Title }}</h1>
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/term.html" (dict "context" . "scope" "single") }}
</div>
</header>
<section class="flex flex-col max-w-full mt-0 mb-5 prose dark:prose-invert lg:flex-row">
{{ if .Content }}
<div class="min-w-0 min-h-0 max-w-prose">
{{ .Content }}
</div>
<script>
var oid = "views_term_{{ .Data.Term }}"
var oid_likes = "likes_term_{{ .Data.Term }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
<div class="min-w-0 min-h-0 max-w-prose">
{{ .Content }}
</div>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $jsPage.RelPermalink }}"
integrity="{{ $jsPage.Data.Integrity }}"
data-oid="views_term_{{ .Data.Term }}"
data-oid-likes="likes_term_{{ .Data.Term }}"></script>
{{ end }}
</section>
{{ if gt .Pages 0 }}
{{ $cardView := .Params.cardView | default (.Site.Params.term.cardView | default false) }}
{{ $cardViewScreenWidth := .Site.Params.term.cardViewScreenWidth | default false }}
{{ $groupByYear := .Params.groupByYear | default ($.Site.Params.term.groupByYear | default false) }}
{{ $cardView := .Params.cardView | default (.Site.Params.term.cardView | default false) }}
{{ $cardViewScreenWidth := .Site.Params.term.cardViewScreenWidth | default false }}
{{ $groupByYear := .Params.groupByYear | default ($.Site.Params.term.groupByYear | default false) }}
{{ if not $cardView }}
{{ if not $cardView }}
<section class="space-y-10 w-full">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $groupByYear }}
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
{{ end }}
{{ range .Pages }}
{{ partial "article-link/simple.html" . }}
{{ end }}
{{ end }}
</section>
{{ else if and $cardView (not $cardViewScreenWidth) }}
{{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
</section>
{{ end }}
{{ else }}
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
{{ end }}
</section>
{{ end }}
{{ else if and $cardView $cardViewScreenWidth }}
{{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<div class="relative w-screen max-w-[1600px] px-[30px] left-[calc(max(-50vw,-800px)+50%)]">
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
</section>
</div>
{{ end }}
{{ else }}
<div class="relative w-screen max-w-[1600px] px-[30px] left-[calc(max(-50vw,-800px)+50%)]">
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
{{ end }}
</section>
</div>
{{ end }}
<section class="space-y-10 w-full">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ if $groupByYear }}
<h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
{{ end }}
{{ range .Pages }}
{{ partial "article-link/simple.html" . }}
{{ end }}
{{ end }}
</section>
{{ else if and $cardView (not $cardViewScreenWidth) }}
{{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
</section>
{{ end }}
{{ else }}
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
{{ end }}
</section>
{{ end }}
{{ else if and $cardView $cardViewScreenWidth }}
{{ if $groupByYear }}
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);">
<h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300">
{{ .Key }}
</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
<section class="mt-10 prose dark:prose-invert">
<p class="py-8 border-t">
<em>{{ i18n "term.no_articles" | emojify }}</em>
</p>
</section>
</div>
{{ end }}
{{ else }}
<div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);">
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
{{ range .Pages }}
{{ partial "article-link/card.html" . }}
{{ end }}
{{ end }}
</section>
</div>
{{ end }}
{{end}}
{{ else }}
<section class="mt-10 prose dark:prose-invert">
<p class="py-8 border-t">
<em>{{ i18n "term.no_articles" | emojify }}</em>
</p>
</section>
{{ end }}
{{ partial "pagination.html" . }}
{{ end }}
{{ end }}

View file

@ -1,17 +1,18 @@
{{ define "main" }}
{{ .Scratch.Set "scope" "list" }}
{{ if .Site.Params.taxonomy.showHero | default false }}
{{ $heroStyle := print "hero/" .Site.Params.taxonomy.heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ .Scratch.Set "scope" "list" }}
{{ if .Site.Params.taxonomy.showHero | default false }}
{{ $heroStyle := print "hero/" .Site.Params.taxonomy.heroStyle ".html" }}
{{ if templates.Exists ( printf "partials/%s" $heroStyle ) }}
{{ partial $heroStyle . }}
{{ else }}
{{ partial "hero/basic.html" . }}
{{ end }}
{{- end -}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.taxonomy.showTableOfContents | default false)) (in
.TableOfContents "<ul")
}}
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.taxonomy.showTableOfContents | default false)) (in
.TableOfContents "<ul") }}
<header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.taxonomy.showBreadcrumbs | default false) }}
@ -28,32 +29,29 @@
{{ .Content }}
</div>
</section>
<script>
var oid = "views_taxonomy_{{ .Data.Plural }}"
var oid_likes = "likes_taxonomy_{{ .Data.Plural }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $jsPage.RelPermalink }}"
integrity="{{ $jsPage.Data.Integrity }}"
data-oid="views_taxonomy_{{ .Data.Plural }}"
data-oid-likes="likes_taxonomy_{{ .Data.Plural }}"></script>
{{ end }}
{{ if .Site.Params.taxonomy.cardView }}
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range .Data.Terms }}
{{ partial "term-link/card.html" . }}
{{ end }}
</section>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range .Data.Terms }}
{{ partial "term-link/card.html" . }}
{{ end }}
</section>
{{ else }}
<section class="flex flex-wrap max-w-prose -mx-2 overflow-hidden">
{{ range .Data.Terms }}
{{ partial "term-link/text.html" . }}
{{ end }}
</section>
<section class="flex flex-wrap max-w-prose -mx-2 overflow-hidden">
{{ range .Data.Terms }}
{{ partial "term-link/text.html" . }}
{{ end }}
</section>
{{ end }}
{{ end }}