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,5 +1,11 @@
{{ if isset site.Params.fathomAnalytics "domain" }}
<script defer src="https://{{ site.Params.fathomAnalytics.domain }}/script.js" data-site="{{ site.Params.fathomAnalytics.site }}"></script>
<script
defer
src="https://{{ site.Params.fathomAnalytics.domain }}/script.js"
data-site="{{ site.Params.fathomAnalytics.site }}"></script>
{{ else }}
<script defer src="https://cdn.usefathom.com/script.js" data-site="{{ site.Params.fathomAnalytics.site }}"></script>
{{ end }}
<script
defer
src="https://cdn.usefathom.com/script.js"
data-site="{{ site.Params.fathomAnalytics.site }}"></script>
{{ end }}

View file

@ -1,8 +1,10 @@
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.Config.Services.GoogleAnalytics.ID }}"></script>
<script
async
src="https://www.googletagmanager.com/gtag/js?id={{ site.Config.Services.GoogleAnalytics.ID }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ site.Config.Services.GoogleAnalytics.ID }}');
</script>
</script>

View file

@ -1,12 +1,12 @@
{{ with site.Params.fathomAnalytics.site }}
{{ partial "analytics/fathom.html" }}
{{ partial "analytics/fathom.html" }}
{{ end }}
{{ with site.Config.Services.GoogleAnalytics.ID }}
{{ partial "analytics/ga.html" }}
{{ partial "analytics/ga.html" }}
{{ end }}
{{ with site.Params.umamiAnalytics.websiteid }}
{{ partial "analytics/umami.html" }}
{{ partial "analytics/umami.html" }}
{{ end }}
{{ with site.Params.selineAnalytics.token }}
{{ partial "analytics/seline.html" }}
{{ end }}
{{ partial "analytics/seline.html" }}
{{ end }}

View file

@ -1,18 +1,21 @@
<script async src="https://cdn.seline.so/seline.js" data-token="{{ site.Params.selineAnalytics.token }}" data-id="seline-script"></script>
<script
async
src="https://cdn.seline.so/seline.js"
data-token="{{ site.Params.selineAnalytics.token }}"
data-id="seline-script"></script>
{{ if .Site.Params.selineAnalytics.enableTrackEvent | default true }}
<script type="text/javascript">
document.querySelector('script[data-id="seline-script"]')
.addEventListener('load', function () {
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content');
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content');
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
<script type="text/javascript">
document.querySelector('script[data-id="seline-script"]').addEventListener("load", function () {
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute("content");
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute("content");
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute("content");
seline.track("user:" + type + ':' + title, {
type: type,
title: title,
url: url
});
});
</script>
seline.track("user:" + type + ":" + title, {
type: type,
title: title,
url: url,
});
});
</script>
{{ end }}

View file

@ -1,23 +1,27 @@
{{/* prettier-ignore-start */}}
{{ if isset site.Params.umamiAnalytics "domain" }}
<script data-id="umami-script" async
src="https://{{ site.Params.umamiAnalytics.domain }}/{{ with site.Params.umamiAnalytics.scriptName }}{{ . }}{{ else }}script.js{{ end }}"
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}"
{{ with site.Params.umamiAnalytics.dataDomains }}data-domains="{{ . }}"{{ end }}>
</script>
<script
data-id="umami-script"
async
src="https://{{ site.Params.umamiAnalytics.domain }}/{{ with site.Params.umamiAnalytics.scriptName }}{{ . }}{{ else }}script.js{{ end }}"
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}"
{{ with site.Params.umamiAnalytics.dataDomains }}data-domains="{{ . }}"{{ end }}></script>
{{ else }}
<script data-id="umami-script" async src="https://analytics.umami.is/script.js"
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}">
</script>
<script
data-id="umami-script"
async
src="https://analytics.umami.is/script.js"
data-website-id="{{ site.Params.umamiAnalytics.websiteid }}"></script>
{{ end }}
{{/* prettier-ignore-end */}}
{{ if .Site.Params.umamiAnalytics.enableTrackEvent | default true }}
<script type="text/javascript">
document.querySelector('script[data-id="umami-script"]')
.addEventListener('load', function () {
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content');
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content');
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
umami.track(type + ':' + title, {'url': url});
<script type="text/javascript">
document.querySelector('script[data-id="umami-script"]').addEventListener("load", function () {
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute("content");
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute("content");
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute("content");
umami.track(type + ":" + title, { url: url });
});
</script>
{{ end }}
</script>
{{ end }}

View file

@ -0,0 +1,5 @@
{{ with .Params.externalUrl }}
href="{{ . }}" target="_blank" rel="external"
{{ else }}
href="{{ .RelPermalink }}"
{{- end -}}

View file

@ -35,15 +35,15 @@
{{- end -}}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<span class="absolute top-0 right-0 m-2">
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
</span>
{{ end }}
{{ end }}
<div class="px-6 py-4">
{{ with .Params.externalUrl }}
<div class="px-6 py-4">
{{ with .Params.externalUrl }}
<div>
<div
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
@ -54,23 +54,25 @@
</span>
</div>
</div>
{{ else }}
<div class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">{{ .Title | emojify }}</div>
{{ end }}
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta/basic.html" . }}
{{ else }}
<div
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">
{{ .Title | emojify }}
</div>
{{ end }}
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta/basic.html" . }}
</div>
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
<div class="py-1 prose dark:prose-invert">
{{ .Summary | plainify }}
</div>
{{ end }}
</div>
<div class="px-6 pt-4 pb-2">
</div>
{{ end }}
</div>
</a>
<div class="px-6 pt-4 pb-2"></div>
</div>
</a>

View file

@ -35,16 +35,15 @@
{{- end -}}
{{- end -}}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<span class="absolute top-0 right-0 m-2">
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
</span>
{{ end }}
{{ end }}
<div class="px-6 py-4">
{{ with .Params.externalUrl }}
<div class="px-6 py-4">
{{ with .Params.externalUrl }}
<div>
<div
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
@ -55,23 +54,25 @@
</span>
</div>
</div>
{{ else }}
<div class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">{{ .Title | emojify }}</div>
{{ end }}
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta/basic.html" . }}
{{ else }}
<div
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">
{{ .Title | emojify }}
</div>
{{ end }}
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta/basic.html" . }}
</div>
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
<div class="py-1 prose dark:prose-invert">
{{ .Summary | plainify }}
</div>
{{ end }}
</div>
<div class="px-6 pt-4 pb-2">
</div>
{{ end }}
</div>
</a>
<div class="px-6 pt-4 pb-2"></div>
</div>
</a>

View file

@ -2,38 +2,34 @@
{{ $articleClasses := "flex flex-wrap md:flex-nowrap article" }}
{{ if .Site.Params.list.showCards }}
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md overflow-hidden") " " }}
{{ $articleClasses = delimit (slice $articleClasses "border border-neutral-200 dark:border-neutral-700 border-2 rounded-md overflow-hidden") " " }}
{{ else }}
{{ $articleClasses = delimit (slice $articleClasses "") " " }}
{{ $articleClasses = delimit (slice $articleClasses "") " " }}
{{ end }}
{{ $articleImageClasses := "w-full md:w-auto h-full thumbnail nozoom" }}
{{ if .Site.Params.list.showCards }}
{{ $articleImageClasses = delimit (slice $articleImageClasses "") " " }}
{{ $articleImageClasses = delimit (slice $articleImageClasses "") " " }}
{{ else }}
{{ $articleImageClasses = delimit (slice $articleImageClasses "thumbnailshadow md:mr-7") " " }}
{{ $articleImageClasses = delimit (slice $articleImageClasses "thumbnailshadow md:mr-7") " " }}
{{ end }}
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ $articleInnerClasses := "" }}
{{ if .Site.Params.list.showCards }}
{{ $articleInnerClasses = delimit (slice $articleInnerClasses "p-4") " " }}
{{ $articleInnerClasses = delimit (slice $articleInnerClasses "p-4") " " }}
{{ else }}
{{ $articleInnerClasses = delimit (slice $articleInnerClasses "mt-3 md:mt-0") " " }}
{{ $articleInnerClasses = delimit (slice $articleInnerClasses "mt-3 md:mt-0") " " }}
{{ end }}
{{ if $constrainItemsWidth }}
{{ $articleClasses = delimit (slice $articleClasses "max-w-prose") " " }}
{{ $articleClasses = delimit (slice $articleClasses "max-w-prose") " " }}
{{ end }}
{{ with .Params.externalUrl }}
<a class="{{ $articleClasses }}" href="{{ . }}" target="_blank" rel="external">
{{ else }}
<a class="{{ $articleClasses }}" href="{{ .RelPermalink }}">
{{ end }}
{{- with $.Params.images -}}
<a class="{{ $articleClasses }}" {{ partial "article-link/_external-link.html" . | safeHTMLAttr }}>
{{- with $.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}" />{{ end -}}
{{- else -}}
@ -63,9 +59,9 @@
{{- end -}}
<div class="{{ $articleInnerClasses }}">
<div class="items-center text-left text-xl font-semibold">
{{ with .Params.externalUrl }}
<div class="{{ $articleInnerClasses }}">
<div class="items-center text-left text-xl font-semibold">
{{ with .Params.externalUrl }}
<div>
<div
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
@ -76,26 +72,29 @@
</span>
</div>
</div>
{{ else }}
<div class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">{{ .Title | emojify }}</div>
{{ end }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
{{ else }}
<div
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
href="{{ .RelPermalink }}">
{{ .Title | emojify }}
</div>
{{ end }}
{{ if and .Draft .Site.Params.article.showDraftLabel }}
<div class=" ltr:ml-2 rtl:mr-2">
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
</div>
{{ end }}
{{ if templates.Exists "partials/extend-article-link.html" }}
{{ end }}
{{ if templates.Exists "partials/extend-article-link.html" }}
{{ partial "extend-article-link.html" . }}
{{ end }}
</div>
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta/basic.html" . }}
</div>
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
{{ end }}
</div>
<div class="text-sm text-neutral-500 dark:text-neutral-400">
{{ partial "article-meta/basic.html" . }}
</div>
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
<div class="py-1 max-w-fit prose dark:prose-invert">
{{ .Summary | plainify }}
</div>
{{ end }}
</div>
</a>
{{ end }}
</div>
</a>

View file

@ -9,91 +9,117 @@
{{ end }}
{{ with $context }}
{{ $meta := newScratch }}
{{ $meta := newScratch }}
{{/* Gather partials for this context */}}
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
{{else if and (eq $scope "single") (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
{{ end }}
{{ if and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial
"functions/date.html" .Date) (partial "functions/date.html" .Lastmod)) (gt (.Lastmod | time.Format "2006") 1) }}
{{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }}
{{ end }}
{{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }}
{{ $meta.Add "partials" (slice (partial "meta/word-count.html" .)) }}
{{ end }}
{{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0)
}}
{{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
{{ end }}
{{ if and (not .Params.externalURL) (.Params.showViews | default (.Site.Params.article.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if and (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showEdit | default (.Site.Params.article.showEdit | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/edit.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showZenMode | default (.Site.Params.article.showZenMode | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/zen-mode.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{/* Gather partials for this context */}}
{{ $shouldShowDate := false }}
{{ if and (eq $scope "single") (.Params.showDateOnlyInArticle | default (.Site.Params.article.showDateOnlyInArticle | default false)) }}
{{ $shouldShowDate = true }}
{{ end }}
{{/* Output draft label */}}
{{ if and (eq $scope "single") (and .Draft .Site.Params.article.showDraftLabel) }}
<span class="pl-2">{{ partial "badge.html" (i18n "article.draft" | emojify) }}</span>
{{/* showDate has higher priority than showDateOnlyInArticle */}}
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
{{ $shouldShowDate = true }}
{{ else }}
{{ $shouldShowDate = false }}
{{ end }}
</div>
{{ if .Params.showAuthorsBadges | default (.Site.Params.article.showAuthorsBadges | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range $taxonomy, $terms := .Site.Taxonomies }}
{{ if (eq $taxonomy "authors")}}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $i, $a := $context.GetTerms $taxonomy }}
{{ if not (eq $i 0) }} ,&nbsp; {{ end }} <div style="cursor: pointer;" onclick="window.open({{ $a.RelPermalink }},'_self');return false;">{{ $a.LinkTitle }}</div>
{{ if $shouldShowDate }}
{{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{/* Output taxonomies */}}
{{ if .Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range $taxonomy, $terms := .Site.Taxonomies }}
{{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series"))}}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $context.GetTerms $taxonomy }}
<span style="margin-top:0.5rem" class="mr-2" onclick="window.open({{ .RelPermalink }},'_self');return false;">
{{ partial "badge.html" .LinkTitle }}
</span>
{{ if and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial
"functions/date.html" .Date) (partial "functions/date.html" .Lastmod)) (gt (.Lastmod | time.Format "2006") 1)
}}
{{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }}
{{ end }}
{{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }}
{{ $meta.Add "partials" (slice (partial "meta/word-count.html" .)) }}
{{ end }}
{{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0) }}
{{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
{{ end }}
{{ if and (not .Params.externalURL) (.Params.showViews | default (.Site.Params.article.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if and (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (not .Params.externalURL) (.Params.showLikes | default (.Site.Params.article.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showEdit | default (.Site.Params.article.showEdit | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/edit.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showZenMode | default (.Site.Params.article.showZenMode | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/zen-mode.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }}
{{/* Output draft label */}}
{{ if and (eq $scope "single") (and .Draft .Site.Params.article.showDraftLabel) }}
<span class="pl-2">{{ partial "badge.html" (i18n "article.draft" | emojify) }}</span>
{{ end }}
</div>
{{ if .Params.showAuthorsBadges | default (.Site.Params.article.showAuthorsBadges | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range $taxonomy, $terms := .Site.Taxonomies }}
{{ if (eq $taxonomy "authors") }}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $i, $a := $context.GetTerms $taxonomy }}
{{ if not (eq $i 0) }},&nbsp;{{ end }}
<div class="cursor-pointer" onclick="window.open({{ $a.RelPermalink }},'_self');return false;">
{{ $a.LinkTitle }}
</div>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{/* Output taxonomies */}}
{{ if .Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range $taxonomy, $terms := .Site.Taxonomies }}
{{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series")) }}
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
{{ range $context.GetTerms $taxonomy }}
<span
class="mr-2 mt-[0.5rem]"
onclick="window.open({{ .RelPermalink }},'_self');return false;">
{{ partial "badge.html" .LinkTitle }}
</span>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
{{/* Output only category */}}
{{ if .Params.showCategoryOnly | default (.Site.Params.article.showCategoryOnly | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range (.GetTerms "categories") }}
<span class="mr-2 mt-[0.5rem]" onclick="window.open({{ .RelPermalink }},'_self');return false;">
{{ partial "badge.html" .LinkTitle }}
</span>
{{ end }}
</div>
{{ end }}
</div>
{{ end }}
{{ end }}

View file

@ -4,33 +4,32 @@
{{ $scope := default nil }}
{{ if (reflect.IsMap . ) }}
{{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }}
{{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }}
{{ end }}
{{ with $context }}
{{ $meta := newScratch }}
{{ $meta := newScratch }}
{{/* Gather partials for this context */}}
{{/* Gather partials for this context */}}
{{ if (.Params.showViews | default (.Site.Params.list.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
{{ if (.Params.showViews | default (.Site.Params.list.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
</div>
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.list.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }}
</div>
{{ end }}

View file

@ -4,33 +4,32 @@
{{ $scope := default nil }}
{{ if (reflect.IsMap . ) }}
{{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }}
{{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }}
{{ end }}
{{ with $context }}
{{ $meta := newScratch }}
{{ $meta := newScratch }}
{{/* Gather partials for this context */}}
{{/* Gather partials for this context */}}
{{ if (.Params.showViews | default (.Site.Params.taxonomy.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
{{ if (.Params.showViews | default (.Site.Params.taxonomy.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
</div>
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.taxonomy.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }}
</div>
{{ end }}

View file

@ -4,33 +4,32 @@
{{ $scope := default nil }}
{{ if (reflect.IsMap . ) }}
{{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }}
{{ $context = .context }}
{{ $scope = cond (not .scope) nil .scope }}
{{ end }}
{{ with $context }}
{{ $meta := newScratch }}
{{ $meta := newScratch }}
{{/* Gather partials for this context */}}
{{/* Gather partials for this context */}}
{{ if (.Params.showViews | default (.Site.Params.term.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML}}
{{ if (.Params.showViews | default (.Site.Params.term.showViews | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/views.html" .)) }}
{{ end }}
</div>
{{ end }}
{{ if (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes.html" .)) }}
{{ end }}
{{ if and (eq $scope "single") (.Params.showLikes | default (.Site.Params.term.showLikes | default false)) }}
{{ $meta.Add "partials" (slice (partial "meta/likes_button.html" .)) }}
{{ end }}
<div class="flex flex-row flex-wrap items-center">
{{/* Output partials */}}
{{ with ($meta.Get "partials") }}
{{ delimit . "<span class=\"px-2 text-primary-500\">&middot;</span>" | safeHTML }}
{{ end }}
</div>
{{ end }}

View file

@ -7,7 +7,7 @@
{{ $prev = .NextInSection }}
{{ end }}
<div class="pt-8">
<hr class="border-dotted border-neutral-300 dark:border-neutral-600" />
<hr class="border-dotted border-neutral-300 dark:border-neutral-600">
<div class="flex justify-between pt-3">
<span>
{{ if $prev }}
@ -21,8 +21,7 @@
>&rarr;</span
>
<span class="flex flex-col">
<span
class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
<span class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
>{{ $prev.Title | emojify }}</span
>
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
@ -38,8 +37,7 @@
{{ if $next }}
<a class="flex text-right group ml-3" href="{{ $next.RelPermalink }}">
<span class="flex flex-col">
<span
class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
<span class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
>{{ $next.Title | emojify }}</span
>
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">

View file

@ -1,42 +1,56 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<div class="flex author author-extra mt-4">
{{ with .data.image }}
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
src="{{ $authorImage.RelPermalink }}" />
{{ else }}
{{ $authorImage := resources.GetRemote . }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
src="{{ $authorImage.RelPermalink }}" />
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img
class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
src="{{ $authorImage.RelPermalink }}">
{{ else }}
{{ $authorImage := resources.GetRemote . }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img
class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
src="{{ $authorImage.RelPermalink }}">
{{ end }}
{{ end }}
<div class="place-self-center">
{{ $link := .link}}
{{ $link := .link }}
{{ with .data.name | markdownify | emojify }}
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
{{ i18n "author.byline_title" | markdownify }}
</div>
<a {{ if $link }} href="{{ $link }}" {{ end }} class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . }}
</a>
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
{{ i18n "author.byline_title" | markdownify }}
</div>
<a
{{ if $link }}href="{{ $link }}"{{ end }}
class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . }}
</a>
{{ end }}
{{ with .data.bio | markdownify }}
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
{{ end }}
<div class="text-2xl sm:text-lg">
<div class="flex flex-wrap text-neutral-400 dark:text-neutral-500">
{{ range .data.social }}
{{ range $name, $link := . }}
<a class="px-1 hover:text-primary-700 dark:hover:text-primary-400" href="{{ $link }}" target="_blank"
aria-label="{{ $name | title }}" rel="me noopener noreferrer"><span class="inline-block align-text-bottom">{{ partial "icon.html" $name }}</span></a>
{{ end }}
{{ range $name, $link := . }}
<a
class="px-1 hover:text-primary-700 dark:hover:text-primary-400"
href="{{ $link }}"
target="_blank"
aria-label="{{ $name | title }}"
rel="me noopener noreferrer"
><span class="inline-block align-text-bottom">{{ partial "icon.html" $name }}</span></a
>
{{ end }}
{{ end }}
</div>
</div>

View file

@ -11,28 +11,36 @@
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
<img
class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ else }}
{{ $authorImage := resources.GetRemote . }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
<img
class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
width="96"
height="96"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ end }}
{{ end }}
<div class="place-self-center">
{{ with .Site.Params.Author.name | markdownify }}
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
{{ i18n "author.byline_title" | markdownify }}
</div>
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . }}
</div>
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
{{ i18n "author.byline_title" | markdownify }}
</div>
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . }}
</div>
{{ end }}
{{ with .Site.Params.Author.bio | markdownify }}
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
{{ end }}
<div class="text-2xl sm:text-lg">{{ partialCached "author-links.html" . }}</div>
</div>

View file

@ -1,5 +1,6 @@
<span class="flex" style="cursor: pointer;">
<span class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
<span class="flex cursor-pointer">
<span
class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
{{ . }}
</span>
</span>
</span>

View file

@ -7,10 +7,8 @@
{{ else if not .p1.IsHome }}
{{ template "crumb" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
{{ end }}
<li class="{{ if or (eq .p1 .p2) (.p1.IsHome) }}hidden{{else}}inline{{ end }}">
<a
class="hover:underline decoration-neutral-300 dark:underline-neutral-600"
href="{{ .p1.RelPermalink }}"
<li class="{{ if or (eq .p1 .p2) (.p1.IsHome) }}hidden{{ else }}inline{{ end }}">
<a class="hover:underline decoration-neutral-300 dark:underline-neutral-600" href="{{ .p1.RelPermalink }}"
>{{ if .p1.Title }}
{{- .p1.Title -}}
{{ else }}

View file

@ -2,50 +2,53 @@
{{/* Footer menu */}}
{{ if .Site.Params.footer.showMenu | default true }}
{{ if .Site.Menus.footer }}
<nav class="flex flex-row pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
<ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.footer }}
<li class="flex mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2 flex items-center" href="{{ .URL }}"
title="{{ .Title }}">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
{{ .Name | markdownify }}
</a>
</li>
{{ end }}
</ul>
</nav>
<nav class="flex flex-row pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400">
<ul class="flex flex-col list-none sm:flex-row">
{{ range .Site.Menus.footer }}
<li
class="flex mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2 flex items-center"
href="{{ .URL }}"
title="{{ .Title }}">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
{{ .Name | markdownify }}
</a>
</li>
{{ end }}
</ul>
</nav>
{{ end }}
{{ end }}
<div class="flex items-center justify-between">
{{/* Copyright */}}
{{ if .Site.Params.footer.showCopyright | default true }}
<p class="text-sm text-neutral-500 dark:text-neutral-400">
{{- with replace .Site.Params.copyright "{ year }" now.Year }}
{{ . | markdownify }}
{{- else }}
&copy;
{{ now.Format "2006" }}
{{ .Site.Params.Author.name | markdownify }}
{{- end }}
</p>
<p class="text-sm text-neutral-500 dark:text-neutral-400">
{{- with replace .Site.Params.copyright "{ year }" now.Year }}
{{ . | markdownify }}
{{- else }}
&copy;
{{ now.Format "2006" }}
{{ .Site.Params.Author.name | markdownify }}
{{- end }}
</p>
{{ end }}
{{/* Theme attribution */}}
{{ if .Site.Params.footer.showThemeAttribution | default true }}
<p class="text-xs text-neutral-500 dark:text-neutral-400">
{{ $hugo := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a>`
}}
{{ $blowfish := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
href="https://blowfish.page/" target="_blank" rel="noopener noreferrer">Blowfish</a>` }}
{{ i18n "footer.powered_by" (dict "Hugo" $hugo "Theme" $blowfish) | safeHTML }}
</p>
<p class="text-xs text-neutral-500 dark:text-neutral-400">
{{ $hugo := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
href="https://gohugo.io/" target="_blank" rel="noopener noreferrer">Hugo</a>`
}}
{{ $blowfish := printf `<a class="hover:underline hover:decoration-primary-400 hover:text-primary-500"
href="https://blowfish.page/" target="_blank" rel="noopener noreferrer">Blowfish</a>`
}}
{{ i18n "footer.powered_by" (dict "Hugo" $hugo "Theme" $blowfish) | safeHTML }}
</p>
{{ end }}
</div>
@ -57,12 +60,14 @@
scrollOffset: 0,
})
{{ end }}
</script>
{{ $jsProcess := resources.Get "js/process.js" }}
{{ $jsProcess = $jsProcess | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsProcess.RelPermalink }}" integrity="{{ $jsProcess.Data.Integrity }}"></script>
</script> {{ $jsProcess := resources.Get "js/process.js" }}
{{ $jsProcess = $jsProcess | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $jsProcess.RelPermalink }}"
integrity="{{ $jsProcess.Data.Integrity }}"></script>
{{/* Extend footer - eg. for extra scripts, etc. */}}
{{ if templates.Exists "partials/extend-footer.html" }}
{{ partialCached "extend-footer.html" . }}
{{ partialCached "extend-footer.html" . }}
{{ end }}
</footer>

View file

@ -0,0 +1,20 @@
{{ $repoColors := site.Data.repoColors }}
{{ $classNameMap := dict }}
{{ range $language, $unused := $repoColors }}
{{ $className := printf "background-color-%s" (md5 $language) }}
{{ $classNameMap = merge $classNameMap (dict $className $language) }}
{{ end }}
{{ $repoLanguages := slice }}
{{ range site.Pages }}
{{ $matchedClasses := findRE `background-color-[a-f0-9]{32}` .Content }}
{{ range $matchedClasses }}
{{ with index $classNameMap . }}
{{ $repoLanguages = $repoLanguages | append . }}
{{ else }}
{{ $repoLanguages = $repoLanguages | append "fallback" }}
{{ end }}
{{ end }}
{{ end }}
{{ return (uniq $repoLanguages) }}

View file

@ -10,4 +10,4 @@
{{ end }}
{{ end }}
{{ return md5 $uid }}
{{ return md5 $uid }}

View file

@ -1,140 +1,201 @@
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
{{ with .Site.Language.Params.htmlCode | default .Site.LanguageCode }}
<meta http-equiv="content-language" content="{{ . }}" />
<meta http-equiv="content-language" content="{{ . }}">
{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="theme-color">
{{/* Title */}}
{{ if .IsHome -}}
<title>{{ .Site.Title | emojify }}</title>
<meta name="title" content="{{ .Site.Title | emojify }}" />
<title>{{ .Site.Title | emojify }}</title>
<meta name="title" content="{{ .Site.Title | emojify }}">
{{- else -}}
<title>{{ .Title | emojify }} &middot; {{ .Site.Title | emojify }}</title>
<meta name="title" content="{{ .Title | emojify }} &middot; {{ .Site.Title | emojify }}" />
<title>{{ .Title | emojify }} &middot; {{ .Site.Title | emojify }}</title>
<meta name="title" content="{{ .Title | emojify }} &middot; {{ .Site.Title | emojify }}">
{{- end }}
{{/* Metadata */}}
{{ with (.Params.Summary | default .Params.Description) | default .Site.Params.description -}}
<meta name="description" content="{{ . }}" />
<meta name="description" content="{{ . }}">
{{- end }}
{{ with .Params.Tags | default .Site.Params.keywords -}}
<meta name="keywords" content="{{ range . }}{{ . }}, {{ end -}}" />
<meta name="keywords" content="{{ range . }}{{ . }},{{ end -}}">
{{- end }}
{{ with .Site.Params.robots }}
<meta name="robots" content="{{ . }}" />
<meta name="robots" content="{{ . }}">
{{ end }}
{{ with .Params.robots }}
<meta name="robots" content="{{ . }}" />
<meta name="robots" content="{{ . }}">
{{ end }}
<link rel="canonical" href="{{ .Permalink }}" />
<link rel="canonical" href="{{ .Permalink }}">
{{ range .AlternativeOutputFormats -}}
{{ printf `
<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) |
safeHTML }}
{{ printf `
<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) |
safeHTML
}}
{{ end -}}
{{/* Asset bundles */}}
{{ $assets := newScratch }}
{{ $cssScheme := resources.Get (printf "css/schemes/%s.css" (.Site.Params.colorScheme | default "blowfish")) }}
{{ if not $cssScheme }}
{{ $cssScheme = resources.Get "css/schemes/blowfish.css" }}
{{ $cssScheme = resources.Get "css/schemes/blowfish.css" }}
{{ end }}
{{ $assets.Add "css" (slice $cssScheme) }}
{{ $cssMain := resources.Get "css/compiled/main.css" }}
{{ $assets.Add "css" (slice $cssMain) }}
{{ $cssCustom := resources.Get "css/custom.css" }}
{{ if $cssCustom }}
{{ $assets.Add "css" (slice $cssCustom) }}
{{ $assets.Add "css" (slice $cssCustom) }}
{{ end }}
{{ if not .Site.Params.disableImageZoom | default true }}
{{ $cssZoom := resources.Get "lib/zoom/style.css" }}
{{ $assets.Add "css" (slice $cssZoom) }}
{{ end }}
{{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint
"sha512" }}
<link type="text/css" rel="stylesheet" href="{{ $bundleCSS.RelPermalink }}"
integrity="{{ $bundleCSS.Data.Integrity }}" />
(.Site.Params.fingerprintAlgorithm | default "sha512")
}}
<link
type="text/css"
rel="stylesheet"
href="{{ $bundleCSS.RelPermalink }}"
integrity="{{ $bundleCSS.Data.Integrity }}">
{{ $jsAppearance := resources.Get "js/appearance.js" }}
{{ $jsAppearance = $jsAppearance | resources.ExecuteAsTemplate "js/appearance.js" . | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsAppearance.RelPermalink }}"
{{ $jsAppearance = $jsAppearance | resources.ExecuteAsTemplate "js/appearance.js" . | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $jsAppearance.RelPermalink }}"
integrity="{{ $jsAppearance.Data.Integrity }}"></script>
{{ if .Site.Params.enableSearch | default false }}
{{ $jsFuse := resources.Get "lib/fuse/fuse.min.js" }}
{{ $jsSearch := resources.Get "js/search.js" }}
{{ $assets.Add "js" (slice $jsFuse $jsSearch) }}
{{ $jsFuse := resources.Get "lib/fuse/fuse.min.js" }}
{{ $jsSearch := resources.Get "js/search.js" }}
{{ $assets.Add "js" (slice $jsFuse $jsSearch) }}
{{ end }}
{{ if .Site.Params.enableCodeCopy | default false }}
{{ $jsCode := resources.Get "js/code.js" }}
{{ $assets.Add "js" (slice $jsCode) }}
{{ $jsCode := resources.Get "js/code.js" }}
{{ $assets.Add "js" (slice $jsCode) }}
{{ end }}
{{ if .Site.Params.rtl | default false }}
{{ $jsRTL := resources.Get "js/rtl.js" }}
{{ $assets.Add "js" (slice $jsRTL) }}
{{ $jsRTL := resources.Get "js/rtl.js" }}
{{ $assets.Add "js" (slice $jsRTL) }}
{{ end }}
{{ $jsMobileMenu := resources.Get "js/mobilemenu.js" }}
{{ $assets.Add "js" (slice $jsMobileMenu) }}
{{ $buttonLikes := resources.Get "js/button-likes.js" }}
{{ $assets.Add "js" (slice $buttonLikes) }}
{{ $katexRender := resources.Get "js/katex-render.js" }}
{{ $assets.Add "js" (slice $katexRender) }}
{{ if $assets.Get "js" }}
{{ $bundleJS := $assets.Get "js" | resources.Concat "js/main.bundle.js" | resources.Minify | resources.Fingerprint
"sha512" }}
<script defer type="text/javascript" id="script-bundle" src="{{ $bundleJS.RelPermalink }}"
integrity="{{ $bundleJS.Data.Integrity }}" data-copy="{{ i18n "code.copy" }}" data-copied="{{ i18n "code.copied"
}}"></script>
{{ $bundleJS := $assets.Get "js" | resources.Concat "js/main.bundle.js" | resources.Minify | resources.Fingerprint
(.Site.Params.fingerprintAlgorithm | default "sha512")
}}
<script
defer
type="text/javascript"
id="script-bundle"
src="{{ $bundleJS.RelPermalink }}"
integrity="{{ $bundleJS.Data.Integrity }}"
data-copy="{{ i18n "code.copy" }}"
data-copied="{{ i18n "code.copied" }}"></script>
{{ end }}
{{ if not .Site.Params.disableImageZoom | default true }}
{{ $zoomJS := resources.Get "lib/zoom/zoom.min.js" | resources.Fingerprint "sha512" }}
<script src="{{ $zoomJS.RelPermalink }}" integrity="{{ $zoomJS.Data.Integrity }}"></script>
{{ $zoomJS := resources.Get "lib/zoom/zoom.min.umd.js" | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script src="{{ $zoomJS.RelPermalink }}" integrity="{{ $zoomJS.Data.Integrity }}"></script>
{{ end }}
{{/* Icons */}}
{{ if templates.Exists "partials/favicons.html" }}
{{ partialCached "favicons.html" .Site }}
{{ partialCached "favicons.html" .Site }}
{{ else }}
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | relURL }}" />
<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 }}" />
<link rel="apple-touch-icon" sizes="180x180" href="{{ "apple-touch-icon.png" | relURL }}">
<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 }}
{{/* Site Verification */}}
{{ with .Site.Params.verification.google }}
<meta name="google-site-verification" content="{{ . }}" />
<meta name="google-site-verification" content="{{ . }}">
{{ end }}
{{ with .Site.Params.verification.bing }}
<meta name="msvalidate.01" content="{{ . }}" />
<meta name="msvalidate.01" content="{{ . }}">
{{ end }}
{{ with .Site.Params.verification.pinterest }}
<meta name="p:domain_verify" content="{{ . }}" />
<meta name="p:domain_verify" content="{{ . }}">
{{ end }}
{{ with .Site.Params.verification.yandex }}
<meta name="yandex-verification" content="{{ . }}" />
<meta name="yandex-verification" content="{{ . }}">
{{ end }}
{{ with .Site.Params.verification.fediverse }}
<meta name="fediverse:creator" content="{{ . }}" />
<meta name="fediverse:creator" content="{{ . }}">
{{ end }}
{{/* Social */}}
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{- /* Main page always uses this; fallback elsewhere if no feature image */ -}}
{{- /* See https://gohugo.io/templates/embedded/#open-graph */ -}}
{{- $images := .Resources.ByType "image" -}}
{{- $socialImage := $images.GetMatch "*feature*" -}}
{{- if not $socialImage -}}
{{- with .Site.Params.defaultSocialImage -}}
{{- if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") -}}
{{- $socialImage = resources.GetRemote . -}}
{{- else -}}
{{- $socialImage = resources.Get . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- with $socialImage -}}
<meta name="twitter:image" content="{{ .RelPermalink | absURL }}">
<meta property="og:image" content="{{ .RelPermalink | absURL }}">
{{- end -}}
{{/* Schema */}}
{{ partial "schema.html" . }}
{{/* Me */}}
{{ with .Site.Params.Author.name }}
<meta name="author" content="{{ . }}" />{{ end }}
<meta name="author" content="{{ . }}">
{{ end }}
{{ with .Site.Params.Author.links }}
{{ range $links := . }}
{{ range $name, $url := $links }}
{{ if not (strings.HasPrefix $url "mailto:") }}
<link href="{{ $url }}" rel="me" />{{ end }}
{{ end }}
{{ end }}
{{ range $links := . }}
{{ range $name, $url := $links }}
{{ if not (strings.HasPrefix $url "mailto:") }}
<link href="{{ $url }}" rel="me">
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{/* Vendor */}}
{{ partial "vendor.html" . }}
{{/* Analytics */}}
{{ partial "analytics/main.html" .Site }}
{{/* Extend head - eg. for custom analytics scripts, etc. */}}
{{ if templates.Exists "partials/extend-head.html" }}
{{ partialCached "extend-head.html" .Site }}
{{ partialCached "extend-head.html" .Site }}
{{ end }}
<meta name="theme-color"/>
{{/* Uncached extend head - Example: https://gohugo.io/methods/page/hasshortcode/ */}}
{{ if templates.Exists "partials/extend-head-uncached.html" }}
{{ partial "extend-head-uncached.html" . }}
{{ end }}
{{/* Firebase */}}
{{ with $.Site.Params.firebase }}
{{ if isset $.Site.Params "firebase" }}
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-auth.js"></script>
{{ if isset $.Site.Params "firebase" }}
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-auth.js"></script>
<script>
const firebaseConfig = {
@ -152,6 +213,11 @@
var auth = firebase.auth();
</script>
{{ end }}
{{ end }}
{{/* Advertisement */}}
{{ with .Site.Params.advertisement.adsense }}
<meta name="google-adsense-account" content="{{ . }}">
{{ end }}
</head>

View file

@ -1,183 +1,208 @@
<div style="padding-left:0;padding-right:0;padding-top:2px;padding-bottom:3px"
class="main-menu flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start gap-x-3">
{{ if .Site.Params.Logo }}
{{/* Logo section */}}
{{ define "HeaderLogo" }}
{{ if .Site.Params.Logo }}
{{ $logo := resources.Get .Site.Params.Logo }}
{{ if $logo }}
<div>
<div>
<a href="{{ "" | relLangURL }}" class="flex">
<span class="sr-only">{{ .Site.Title | markdownify }}</span>
{{ if eq $logo.MediaType.SubType "svg" }}
<span class="sr-only">{{ .Site.Title | markdownify }}</span>
{{ if eq $logo.MediaType.SubType "svg" }}
<span class="logo object-scale-down object-left nozoom">
{{ $logo.Content | safeHTML }}
{{ $logo.Content | safeHTML }}
</span>
{{ else }}
<img src="{{ $logo.RelPermalink }}" width="{{ div $logo.Width 2 }}" height="{{ div $logo.Height 2 }}"
class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom" alt="{{ .Site.Title }}" />
{{ end }}
{{ else }}
<img
src="{{ $logo.RelPermalink }}"
width="{{ div $logo.Width 2 }}"
height="{{ div $logo.Height 2 }}"
class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom"
alt="{{ .Site.Title }}">
{{ end }}
</a>
</div>
</div>
{{ end }}
{{- end }}
<div class="flex flex-1 items-center justify-between">
<nav class="flex space-x-3">
{{- end }}
{{ end }}
{{ if not .Site.Params.disableTextInHeader | default true }}
<a href="{{ "" | relLangURL }}" class="text-base font-medium text-gray-500 hover:text-gray-900">{{
.Site.Title | markdownify
}}</a>
{{ end }}
{{/* Desktop navigation */}}
{{ define "HeaderDesktopNavigation" }}
<nav class="hidden md:flex items-center gap-x-5 md:ml-12 h-12">
{{ if .Site.Menus.main }}
{{ range .Site.Menus.main }}
{{ partial "header/header-option.html" . }}
{{ end }}
{{ end }}
</nav>
<nav class="hidden md:flex items-center gap-x-5 md:ml-12 h-12">
{{ partial "translations.html" . }}
{{ if .Site.Menus.main }}
{{ range .Site.Menus.main }}
{{ partial "header/header-option.html" . }}
{{ end }}
{{ end }}
{{ if .Site.Params.enableSearch | default false }}
<button
id="search-button"
aria-label="Search"
class="text-base hover:text-primary-600 dark:hover:text-primary-400"
title="{{ i18n "search.open_button_title" }}">
{{ partial "icon.html" "search" }}
</button>
{{ end }}
{{ partial "translations.html" . }}
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
<div class="{{ if .Site.Params.footer.showScrollToTop | default true -}}{{- end }} flex items-center">
<button
id="appearance-switcher"
aria-label="Dark mode switcher"
type="button"
class="text-base hover:text-primary-600 dark:hover:text-primary-400">
<div class="flex items-center justify-center dark:hidden">
{{ partial "icon.html" "moon" }}
</div>
<div class="items-center justify-center hidden dark:flex">
{{ partial "icon.html" "sun" }}
</div>
</button>
</div>
{{ end }}
</nav>
{{ end }}
{{ if .Site.Params.enableSearch | default false }}
<button id="search-button" aria-label="Search" class="text-base hover:text-primary-600 dark:hover:text-primary-400"
title="{{ i18n " search.open_button_title" }}">
{{ partial "icon.html" "search" }}
</button>
{{ end }}
{{/* Mobile navigation */}}
{{ define "HeaderMobileNavigation" }}
<div class="flex md:hidden items-center gap-x-5 md:ml-12 h-12">
<span></span>
{{ partial "translations.html" . }}
{{ if .Site.Params.enableSearch | default false }}
<button
id="search-button-mobile"
aria-label="Search"
class="text-base hover:text-primary-600 dark:hover:text-primary-400"
title="{{ i18n "search.open_button_title" }}">
{{ partial "icon.html" "search" }}
</button>
{{ end }}
{{/* Appearance switch */}}
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
<div
class="{{ if .Site.Params.footer.showScrollToTop | default true -}} {{- end }} flex items-center">
<button id="appearance-switcher" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400">
<div class="flex items-center justify-center dark:hidden">
{{ partial "icon.html" "moon" }}
</div>
<div class="items-center justify-center hidden dark:flex">
{{ partial "icon.html" "sun" }}
</div>
</button>
</div>
{{ end }}
</nav>
<div class="flex md:hidden items-center gap-x-5 md:ml-12 h-12">
<span></span>
{{ partial "translations.html" . }}
{{ if .Site.Params.enableSearch | default false }}
<button id="search-button-mobile" aria-label="Search" class="text-base hover:text-primary-600 dark:hover:text-primary-400"
title="{{ i18n " search.open_button_title" }}">
{{ partial "icon.html" "search" }}
</button>
{{ end }}
{{/* Appearance switch */}}
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
<button id="appearance-switcher-mobile" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400 ltr:mr-1 rtl:ml-1">
<div class="flex items-center justify-center dark:hidden">
{{ partial "icon.html" "moon" }}
</div>
<div class="items-center justify-center hidden dark:flex">
{{ partial "icon.html" "sun" }}
</div>
</button>
{{ end }}
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
<button
id="appearance-switcher-mobile"
aria-label="Dark mode switcher"
type="button"
class="text-base hover:text-primary-600 dark:hover:text-primary-400 ltr:mr-1 rtl:ml-1">
<div class="flex items-center justify-center dark:hidden">
{{ partial "icon.html" "moon" }}
</div>
</div>
<div class="-my-2 md:hidden">
<div class="items-center justify-center hidden dark:flex">
{{ partial "icon.html" "sun" }}
</div>
</button>
{{ end }}
</div>
{{ end }}
<label id="menu-button" class="block">
{{ if .Site.Menus.main }}
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
{{ partial "icon.html" "bars" }}
</div>
<div id="menu-wrapper" style="padding-top:5px;"
class="fixed inset-0 z-30 invisible w-screen h-screen m-0 overflow-auto transition-opacity opacity-0 cursor-default bg-neutral-100/50 backdrop-blur-sm dark:bg-neutral-900/50">
<ul
class="flex space-y-2 mt-3 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
{{ define "HeaderMobileMenu" }}
<div class="-my-2 md:hidden">
<div id="menu-button" class="block">
{{ if .Site.Menus.main }}
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
{{ partial "icon.html" "bars" }}
</div>
<div
id="menu-wrapper"
class="fixed inset-0 z-30 invisible w-screen h-screen m-0 overflow-auto transition-opacity opacity-0 cursor-default bg-neutral-100/50 backdrop-blur-sm dark:bg-neutral-900/50 pt-[5px]">
<ul
class="flex space-y-2 mt-3 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
<li id="menu-close-button">
<span
class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400">
{{ partial "icon.html" "xmark" }}
</span>
</li>
<li id="menu-close-button">
<span
class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400">{{
partial
"icon.html"
"xmark" }}</span>
</li>
{{ range .Site.Menus.main }}
{{ partial "header/header-mobile-option.html" . }}
{{ range .Site.Menus.main }}
{{ partial "header/header-mobile-option.html" . }}
{{ end }}
</ul>
{{ if .Site.Menus.subnavigation }}
<hr>
<ul
class="flex mt-4 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
{{ range .Site.Menus.subnavigation }}
<li class="mb-1">
<a
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:") }}
target="_blank"
{{ end }}
</ul>
{{ if .Site.Menus.subnavigation }}
<hr>
<ul
class="flex mt-4 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
{{ range .Site.Menus.subnavigation }}
<li class="mb-1">
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
) }} target="_blank" {{ end }} class="flex items-center">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-3" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-sm font-sm text-gray-500 hover:text-gray-900" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
</li>
class="flex items-center">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-3"{{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
</ul>
{{ end }}
{{ end }}
</div>
</label>
<p class="text-sm font-sm text-gray-500 hover:text-gray-900" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
{{ end }}
</div>
</div>
{{ end }}
{{/* ========== Render HTML ========== */}}
<div
class="main-menu flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start gap-x-3 pt-[2px] pr-0 pb-[3px] pl-0">
{{ template "HeaderLogo" . }}
<div class="flex flex-1 items-center justify-between">
<nav class="flex space-x-3">
{{ if not .Site.Params.disableTextInHeader | default true }}
<a href="{{ "" | relLangURL }}" class="text-base font-medium text-gray-500 hover:text-gray-900">
{{ .Site.Title | markdownify }}
</a>
{{ end }}
</nav>
{{ template "HeaderDesktopNavigation" . }}
{{ template "HeaderMobileNavigation" . }}
</div>
{{ template "HeaderMobileMenu" . }}
</div>
{{ if .Site.Menus.subnavigation }}
<div class="main-menu flex pb-3 flex-col items-end justify-between md:justify-start space-x-3" {{ if .Site.Params.Logo
}} style="margin-top:-15px" {{ end }}>
<div
class="main-menu flex pb-3 flex-col items-end justify-between md:justify-start space-x-3{{ if .Site.Params.Logo }} -mt-[15px]{{ end }}">
<div class="hidden md:flex items-center space-x-5">
{{ range .Site.Menus.subnavigation }}
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank" {{ end }} class="flex items-center">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
{{ range .Site.Menus.subnavigation }}
<a
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank"
{{ end }}
class="flex items-center">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-xs font-light text-gray-500 hover:text-gray-900" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
{{ end }}
<p class="text-xs font-light text-gray-500 hover:text-gray-900" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
{{ end }}
{{ end }}
</div>
</div>
</div>
{{ end }}
{{ if .Site.Params.highlightCurrentMenuArea }}
<script>
<script>
(function () {
var $mainmenu = $('.main-menu');
var path = window.location.pathname;
$mainmenu.find('a[href="' + path + '"]').each(function (i, e) {
$(e).children('p').addClass('active');
});
var $mainmenu = $(".main-menu");
var path = window.location.pathname;
$mainmenu.find('a[href="' + path + '"]').each(function (i, e) {
$(e).children("p").addClass("active");
});
})();
</script>
</script>
{{ end }}

View file

@ -1,14 +1,16 @@
<div class="min-h-[148px]"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px]" style="z-index:100">
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom bg-neutral dark:bg-neutral-800"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px] z-100">
<div
id="menu-blur"
class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom bg-neutral dark:bg-neutral-800"></div>
<div class="relative max-w-[64rem] ml-auto mr-auto">
{{ partial "header/basic.html" . }}
</div>
</div>
<script>
window.addEventListener('scroll', function (e) {
var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
var background_blur = document.getElementById('menu-blur');
background_blur.style.opacity = (scroll / 300);
});
</script>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="menu-blur"></script>

View file

@ -1,5 +1,5 @@
<div class="min-h-[148px]"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px] bg-neutral dark:bg-neutral-800" style="z-index:100">
<div class="fixed inset-x-0 pl-[24px] pr-[24px] bg-neutral dark:bg-neutral-800 z-100">
<div class="relative max-w-[64rem] ml-auto mr-auto">
{{ partial "header/basic.html" . }}
</div>

View file

@ -1,15 +1,18 @@
<div class="min-h-[148px]"></div>
<div class="fixed inset-x-0 min-h-[130px] opacity-65 pl-[24px] pr-[24px] bg-gradient-to-b from-neutral from-60% dark:from-neutral-800 to-transparent mix-blend-normal" style="z-index:80"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px]" style="z-index:100">
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
<div
class="fixed inset-x-0 min-h-[130px] opacity-65 pl-[24px] pr-[24px] bg-gradient-to-b from-neutral from-60% dark:from-neutral-800 to-transparent mix-blend-normal z-80"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px] z-100">
<div
id="menu-blur"
class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
<div class="relative max-w-[64rem] ml-auto mr-auto">
{{ partial "header/basic.html" . }}
</div>
</div>
<script>
window.addEventListener('scroll', function (e) {
var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
var background_blur = document.getElementById('menu-blur');
background_blur.style.opacity = (scroll / 300);
});
</script>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="menu-blur"></script>

View file

@ -1,14 +1,16 @@
<div class="min-h-[148px]"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px]" style="z-index:100">
<div id="menu-blur" class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
<div class="fixed inset-x-0 pl-[24px] pr-[24px] z-100">
<div
id="menu-blur"
class="absolute opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl shadow-2xl"></div>
<div class="relative max-w-[64rem] ml-auto mr-auto">
{{ partial "header/basic.html" . }}
</div>
</div>
<script>
window.addEventListener('scroll', function (e) {
var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
var background_blur = document.getElementById('menu-blur');
background_blur.style.opacity = (scroll / 300);
});
</script>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="menu-blur"></script>

View file

@ -1,31 +1,39 @@
<li class="mt-1">
<a href="{{ .URL }}" class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-bg font-bg" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
<span>
{{ partial "icon.html" "chevron-down" }}
</span>
</a>
<a
href="{{ .URL }}"
class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-bg font-bg" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
<span>
{{ partial "icon.html" "chevron-down" }}
</span>
</a>
</li>
{{ range .Children }}
<li class="mt-1">
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
) }} target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
<li class="mt-1">
<a
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
)
}}
target="_blank"
{{ end }}
class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-sm font-small" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
{{ end }}
<p class="text-sm font-small" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
</li>
</li>
{{ end }}
<li class="mb-2"></li>

View file

@ -1,13 +1,19 @@
<li class="mt-1">
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
) }} target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<div {{ if and .Pre .Name}} class="mr-2" {{ end }}>
{{ partial "icon.html" .Pre }}
</div>
{{ end }}
<p class="text-bg font-bg" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
<a
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
)
}}
target="_blank"
{{ end }}
class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<div {{ if and .Pre .Name }}class="mr-2"{{ end }}>
{{ partial "icon.html" .Pre }}
</div>
{{ end }}
<p class="text-bg font-bg" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
</li>

View file

@ -1,4 +1,4 @@
{{ if .HasChildren }}
{{ if .HasChildren }}
{{ partial "header/header-mobile-option-nested.html" . }}
{{ else }}
{{ partial "header/header-mobile-option-simple.html" . }}

View file

@ -1,12 +1,19 @@
<div>
<div class="cursor-pointer flex items-center nested-menu">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<a {{ if .URL }} href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank" {{ end }} {{ end }} class="text-base font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}">
<a
{{ if .URL }}
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank"
{{ end }}
{{ end }}
class="text-base font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"
title="{{ .Title }}">
{{ .Name | markdownify }}
</a>
<span>
@ -17,17 +24,21 @@
<div class="pt-2 p-5 mt-2 rounded-xl backdrop-blur shadow-2xl">
<div class="flex flex-col space-y-3">
{{ range .Children }}
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-sm font-sm" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
<a
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank"
{{ end }}
class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-sm font-sm" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>
{{ end }}
</div>
</div>

View file

@ -1,11 +1,13 @@
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }} target="_blank" {{
end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
<a
href="{{ .URL }}"
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}target="_blank"{{ end }}
class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-base font-medium" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
{{ end }}
<p class="text-base font-medium" title="{{ .Title }}">
{{ .Name | markdownify }}
</p>
</a>

View file

@ -1,4 +1,4 @@
{{ if .HasChildren }}
{{ if .HasChildren }}
{{ partial "header/header-option-nested.html" . }}
{{ else }}
{{ partial "header/header-option-simple.html" . }}

View file

@ -55,12 +55,8 @@
</div>
{{ if $shouldBlur | default false }}
<div id="background-blur" class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
<script>
window.addEventListener('scroll', function (e) {
var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
var background_blur = document.getElementById('background-blur');
background_blur.style.opacity = (scroll / 300)
});
</script>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $backgroundBlur.RelPermalink }}" integrity="{{ $backgroundBlur.Data.Integrity }}" data-target-id="background-blur"></script>
{{ end }}
{{- end -}}

View file

@ -6,28 +6,32 @@
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if and .Params.featureimage (not $featured) }}
{{- $url:= .Params.featureimage -}}
{{ $featured = resources.GetRemote $url }}
{{- $url:= .Params.featureimage -}}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{- if not $featured }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }}
{{ else }}
{{ $featured = resources.Get . }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }}
{{ else }}
{{ $featured = resources.Get . }}
{{ end }}
{{ end }}
{{ end }}
{{ end -}}
{{- with $featured -}}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg")}}
{{ with . }}
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ if or $disableImageOptimization (strings.HasSuffix $featured ".svg") }}
{{ with . }}
<div
class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{- end -}}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div
class="w-full h-36 md:h-56 lg:h-72 single_hero_basic nozoom"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{- end -}}

View file

@ -6,55 +6,71 @@
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if .Params.featureimage }}
{{- $url:= .Params.featureimage -}}
{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}}
{{- $url:= .Params.featureimage -}}
{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}}
{{ end }}
{{- if not $featured }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }}
{{ else }}
{{ $featured = resources.Get . }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }}
{{ else }}
{{ $featured = resources.Get . }}
{{ end }}
{{ end }}
{{ end }}
{{ end -}}
{{ $caption := "" }}
{{ if .Params.featureimagecaption }}
{{- $caption = .Params.featureimagecaption -}}
{{- $caption = .Params.featureimagecaption -}}
{{ end }}
{{- $alt := .Page.Title -}}
{{- with .Page.Params.alt }}{{ $alt = . }}{{ end -}}
{{- with $featured -}}
{{ if strings.HasSuffix $featured ".svg" }}
{{ with . }}
<figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline" style="text-align: center;"> {{ $caption | markdownify }} </figcaption>
{{end}}
</figure>
{{ end }}
{{ else if $disableImageOptimization }}
{{ with . }}
<figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline" style="text-align: center;"> {{ $caption | markdownify }} </figcaption>
{{end}}
</figure>
{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline" style="text-align: center;"> {{ $caption | markdownify }} </figcaption>
{{end}}
</figure>
{{ if strings.HasSuffix $featured ".svg" }}
{{ with . }}
<figure>
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center">
{{ $caption | markdownify }}
</figcaption>
{{ end }}
</figure>
{{ end }}
{{- end -}}
{{ else if $disableImageOptimization }}
{{ with . }}
<figure>
<img
class="w-full rounded-lg single_hero_round nozoom"
alt="{{ $alt }}"
width="{{ .Width }}"
height="{{ .Height }}"
src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center">
{{ $caption | markdownify }}
</figcaption>
{{ end }}
</figure>
{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<figure>
<img
class="w-full rounded-lg single_hero_round nozoom"
alt="{{ $alt }}"
width="{{ .Width }}"
height="{{ .Height }}"
src="{{ .RelPermalink }}">
{{ if $caption }}
<figcaption class="text-sm text-neutral-700 dark:text-neutral-400 hover:underline text-center">
{{ $caption | markdownify }}
</figcaption>
{{ end }}
</figure>
{{ end }}
{{ end }}
{{- end -}}

View file

@ -2,69 +2,97 @@
{{- $images := .Resources.ByType "image" -}}
{{- $background := $images.GetMatch "*background*" -}}
{{- if not $background }}{{ with .Site.Params.defaultBackgroundImage }}{{ $background = resources.Get . }}{{ end }}{{ end -}}
{{- if not $background }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $background = resources.GetRemote . }}
{{ else }}
{{ $background = resources.Get . }}
{{ end }}
{{ end }}
{{ end -}}
{{- if not $background }}{{ $background = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- if not $background }}{{ $background = $images.GetMatch "*feature*" }}{{ end -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if .Params.featureimage }}
{{- $url:= .Params.featureimage -}}
{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}}
{{- $url:= .Params.featureimage -}}
{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}}
{{ end }}
{{- if not $featured }}{{ $featured = $images.GetMatch "*background*" }}{{ end -}}
{{- if not $featured }}{{ with .Site.Params.defaultBackgroundImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}}
{{ $isParentList := eq (.Scratch.Get "scope") "list" }}
{{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) ($isParentList))
) }}
{{- if not $featured }}
{{ with .Site.Params.defaultFeaturedImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }}
{{ else }}
{{ $featured = resources.Get . }}
{{ end }}
{{ end }}
{{ end -}}
{{ $isParentList := eq (.Scratch.Get "scope") "list" }}
{{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList))
(and ($.Site.Params.list.layoutBackgroundBlur | default true) ($isParentList))
)
}}
{{- with $featured -}}
{{ if or $disableImageOptimization (strings.HasSuffix . ".svg")}}
{{ with . }}
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{ if or $disableImageOptimization (strings.HasSuffix . ".svg") }}
{{ with . }}
<div
class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div
class="w-full rounded-md h-36 md:h-56 lg:h-72 single_hero_basic nozoom"
style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{- end -}}
{{- with $background -}}
{{ if or $disableImageOptimization (strings.HasSuffix . ".svg")}}
{{ with . }}
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
style="background-image:url({{ .RelPermalink }});">
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
</div>
<div
class="absolute inset-0 opacity-30 dark:opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral dark:to-neutral-800 mix-blend-normal">
</div>
</div>{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
style="background-image:url({{ .RelPermalink }});">
<div class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
</div>
<div
class="absolute inset-0 opacity-30 dark:opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral dark:to-neutral-800 mix-blend-normal">
</div>
</div>{{ end }}
{{ end }}
{{ if or $disableImageOptimization (strings.HasSuffix . ".svg") }}
{{ with . }}
<div
class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
style="background-image:url({{ .RelPermalink }});">
<div
class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"></div>
<div
class="absolute inset-0 opacity-30 dark:opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral dark:to-neutral-800 mix-blend-normal"></div>
</div>
{{ end }}
{{ else }}
{{ with .Resize (print ($.Site.Params.backgroundImageWidth | default "1200") "x") }}
<div
class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom"
style="background-image:url({{ .RelPermalink }});">
<div
class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"></div>
<div
class="absolute inset-0 opacity-30 dark:opacity-60 bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral dark:to-neutral-800 mix-blend-normal"></div>
</div>
{{ end }}
{{ end }}
{{- end -}}
{{ if $shouldBlur | default false }}
<div id="background-blur" class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
<script>
window.addEventListener('scroll', function (e) {
var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
var background_blur = document.getElementById('background-blur');
background_blur.style.opacity = (scroll / 300)
});
</script>
<div
id="background-blur"
class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="background-blur"></script>
{{ end }}

View file

@ -1,88 +1,102 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<article class="max-w-full prose dark:prose-invert">
<div class="relative">
<div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
<div class="mx-auto max-w-7xl p-0">
<div class="relative sm:overflow-hidden">
<div class="fixed inset-x-0 top-0" style="z-index:-10">
{{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ if $homepageImage }}
<img class="w-full h-[1000px] object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}" role="presentation" style="margin: 0">
<div
class="absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
</div>
<div
class="opacity-60 absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral-100 dark:to-neutral-800 mix-blend-normal">
</div>
{{ end }}
</div>
<div class="relative px-1 py-1 flex flex-col items-center justify-center text-center">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}
<a class="px-1 hover:text-primary-400 text-primary-800 dark:text-primary-200" href="{{ $url }}" target="_blank"
aria-label="{{ $name | title }}" rel="me noopener noreferrer">{{ partial
"icon.html" $name }}</a>
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
<section class="prose dark:prose-invert">{{ .Content }}</section>
</div>
</div>
<div class="relative">
<div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
<div class="mx-auto max-w-7xl p-0">
<div class="relative sm:overflow-hidden">
<div class="fixed inset-x-0 top-0 -z-10">
{{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ if $homepageImage }}
<img
class="w-full h-[1000px] object-cover nozoom mt-0 mr-0 mb-0 ml-0"
src="{{ $homepageImage.RelPermalink }}"
role="presentation">
<div
class="absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"></div>
<div
class="opacity-60 absolute inset-0 h-[1000px] bg-gradient-to-t from-neutral dark:from-neutral-800 to-neutral-100 dark:to-neutral-800 mix-blend-normal"></div>
{{ end }}
</div>
<div class="relative px-1 py-1 flex flex-col items-center justify-center text-center">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img
class="mb-2 rounded-full h-36 w-36"
width="144"
height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ end }}
{{ end }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}
<a
class="px-1 hover:text-primary-400 text-primary-800 dark:text-primary-200"
href="{{ $url }}"
target="_blank"
aria-label="{{ $name | title }}"
rel="me noopener noreferrer"
>{{ partial
"icon.html" $name
}}</a
>
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
<section class="prose dark:prose-invert w-full">{{ .Content }}</section>
</div>
</div>
</div>
</div>
</article>
<section>
{{ partial "recent-articles/main.html" . }}
{{ partial "recent-articles/main.html" . }}
</section>
{{ if .Site.Params.homepage.layoutBackgroundBlur | default false }}
<div id="background-blur" class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
<script>
window.addEventListener('scroll', function (e) {
var scroll = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
var background_blur = document.getElementById('background-blur');
background_blur.style.opacity = (scroll / 300)
});
</script>
<div
id="background-blur"
class="fixed opacity-0 inset-x-0 top-0 h-full single_hero_background nozoom backdrop-blur-2xl"></div>
{{ $backgroundBlur := resources.Get "js/background-blur.js" }}
{{ $backgroundBlur = $backgroundBlur | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $backgroundBlur.RelPermalink }}"
integrity="{{ $backgroundBlur.Data.Integrity }}"
data-target-id="background-blur"></script>
{{ end }}

View file

@ -1,43 +1,44 @@
<div class="relative pt-16 pb-32">
<div aria-hidden="true" class="absolute inset-x-0 top-0 h-48 bg-gradient-to-b from-gray-100"></div>
<div class="relative">
<div class="lg:mx-auto lg:grid lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-2 lg:gap-24 lg:px-8">
<div class="mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
<article class="max-w-full prose dark:prose-invert">
{{ with .Title }}
<header>
<h1>{{ . | emojify }}</h1>
</header>
{{ end }}
<section>{{ .Content }}</section>
</article>
</div>
<div class="mt-6 sm:mt-16 lg:mt-0 mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
<div class="-mr-48 md:-mr-16 lg:relative lg:m-0 lg:h-full lg:px-0" style="width:100%">
{{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ if $homepageImage }}
<img class="w-full rounded-xl shadow-xl lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none"
src="{{ $homepageImage.RelPermalink }}">
{{ end }}
</div>
</div>
<div aria-hidden="true" class="absolute inset-x-0 top-0 h-48 bg-gradient-to-b from-gray-100"></div>
<div class="relative">
<div class="lg:mx-auto lg:grid lg:max-w-7xl lg:grid-flow-col-dense lg:grid-cols-2 lg:gap-24 lg:px-8">
<div class="mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
<article class="max-w-full prose dark:prose-invert">
{{ with .Title }}
<header>
<h1>{{ . | emojify }}</h1>
</header>
{{ end }}
<section class="w-full">{{ .Content }}</section>
</article>
</div>
<div class="mt-6 sm:mt-16 lg:mt-0 mx-auto max-w-xl px-4 sm:px-6 lg:mx-0 lg:max-w-none lg:py-16 lg:px-0">
<div class="-mr-48 md:-mr-16 lg:relative lg:m-0 lg:h-full lg:px-0 w-full">
{{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ if $homepageImage }}
<img
class="w-full rounded-xl shadow-xl lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none"
src="{{ $homepageImage.RelPermalink }}">
{{ end }}
</div>
</div>
</div>
</div>
</div>
<section>
{{ partial "recent-articles/main.html" . }}
{{ partial "recent-articles/main.html" . }}
</section>

View file

@ -1,75 +1,116 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
{{ $disableHeroImageFilter := .Site.Params.homepage.disableHeroImageFilter | default false }}
<article class="max-w-full prose dark:prose-invert">
<div class="relative">
<div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
<div class="mx-auto max-w-7xl p-0">
<div class="relative shadow-xl sm:overflow-hidden rounded-2xl">
<div class="absolute inset-0">
{{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ if $homepageImage }}
<img class="h-full w-full object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}" style="margin: 0">
<div
class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply">
</div>
{{ end }}
</div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center justify-center text-center">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}
<a class="px-1 hover:text-primary-400 text-primary-300" href="{{ $url }}" target="_blank"
aria-label="{{ $name | title }}" rel="me noopener noreferrer">{{ partial
"icon.html" $name }}</a>
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
<section class="prose prose-invert">{{ .Content }}</section>
</div>
</div>
<div class="relative">
<div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
<div class="mx-auto max-w-7xl p-0">
<div class="relative shadow-xl sm:overflow-hidden rounded-2xl">
<div class="absolute inset-0">
{{ $homepageImage := "" }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ with .Site.Params.homepage.homepageImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $homepageImage = resources.GetRemote . }}
{{ else }}
{{ $homepageImage = resources.Get . }}
{{ end }}
{{ end }}
{{ if $homepageImage }}
<img class="h-full w-full object-cover nozoom mt-0 mr-0 mb-0 ml-0" src="{{ $homepageImage.RelPermalink }}">
{{ if not $disableHeroImageFilter }}
<div
class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply"></div>
{{ else }}
<div
class="absolute inset-0 from-primary-500 to-secondary-600 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply"></div>
{{ end }}
{{ end }}
</div>
<div
class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center justify-center text-center">
{{ with .Site.Params.Author.image }}
{{ $authorImage := "" }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $authorImage = resources.GetRemote . }}
{{ else }}
{{ $authorImage = resources.Get . }}
{{ end }}
{{ if $authorImage }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img
class="mb-2 rounded-full h-36 w-36"
width="144"
height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ end }}
{{ end }}
{{ if not $disableHeroImageFilter }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
{{ else }}
<h1 class="mb-2 text-4xl font-extrabold text-neutral-800 dark:text-neutral-200">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="mt-0 mb-0 text-xl text-neutral-800 dark:text-neutral-300">
{{ . | markdownify }}
</h2>
{{ end }}
{{ end }}
<div class="mt-3 mb-10 text-2xl">
{{ with .Site.Params.Author.links }}
<div class="flex flex-wrap">
{{ range $links := . }}
{{ range $name, $url := $links }}
{{ if not $disableHeroImageFilter }}
<a
class="px-1 hover:text-primary-400 text-primary-300"
href="{{ $url }}"
target="_blank"
aria-label="{{ $name | title }}"
rel="me noopener noreferrer"
>{{ partial
"icon.html" $name
}}</a
>
{{ else }}
<a
class="px-1 hover:text-primary-400 text-primary-800 dark:text-primary-200"
href="{{ $url }}"
target="_blank"
aria-label="{{ $name | title }}"
rel="me noopener noreferrer"
>{{ partial
"icon.html" $name
}}</a
>
{{ end }}
{{ end }}
{{ end }}
</div>
{{ end }}
</div>
<section class="prose prose-invert w-full">{{ .Content }}</section>
</div>
</div>
</div>
</div>
</article>
<section>
{{ partial "recent-articles/main.html" . }}
{{ partial "recent-articles/main.html" . }}
</section>

View file

@ -4,7 +4,7 @@
<h1>{{ . | emojify }}</h1>
</header>
{{ end }}
<section>{{ .Content }}</section>
<section class="w-full">{{ .Content }}</section>
</article>
<section>
{{ partial "recent-articles/main.html" . }}

View file

@ -1,5 +1,6 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<article class="{{ if not .Site.Params.homepage.showRecent }}
<article
class="{{ if not .Site.Params.homepage.showRecent }}
h-full
{{ end }} flex flex-col items-center justify-center text-center">
<header class="relative px-1 py-1 flex flex-col items-center mb-3">
@ -14,23 +15,27 @@
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }}
{{ end }}
<img class="mb-2 rounded-full h-36 w-36" width="144" height="144" alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}" />
<img
class="mb-2 rounded-full h-36 w-36"
width="144"
height="144"
alt="{{ $.Site.Params.Author.name | default " Author" }}"
src="{{ $authorImage.RelPermalink }}">
{{ end }}
{{ end }}
<h1 class="text-4xl font-extrabold">
{{ .Site.Params.Author.name | default .Site.Title }}
</h1>
{{ with .Site.Params.Author.headline }}
<h2 class="text-xl text-neutral-500 dark:text-neutral-400">
{{ . | markdownify }}
</h2>
<h2 class="text-xl text-neutral-500 dark:text-neutral-400">
{{ . | markdownify }}
</h2>
{{ end }}
<div class="mt-1 text-2xl">
{{ partialCached "author-links.html" . }}
</div>
</header>
<section class="prose dark:prose-invert">{{ .Content }}</section>
<section class="prose dark:prose-invert w-full">{{ .Content }}</section>
</article>
<section>
{{ partial "recent-articles/main.html" . }}

View file

@ -0,0 +1,43 @@
{{/*
Copied from Hugo v0.146
Source: https://github.com/gohugoio/hugo/blob/83cfdd78ca6469e6d7265323d9fad1448880e559/tpl/tplimpl/embedded/templates/_shortcodes/figure.html
*/}}
<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
{{- if .Get "link" -}}
<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
{{- end -}}
{{- $u := urls.Parse (.Get "src") -}}
{{- $src := $u.String -}}
{{- if not $u.IsAbs -}}
{{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}}
{{- $src = .RelPermalink -}}
{{- end -}}
{{- end -}}
<img src="{{ $src }}"
{{- if or (.Get "alt") (.Get "caption") }}
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
{{- end -}}
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
{{- with .Get "loading" }} loading="{{ . }}"{{ end -}}
><!-- Closing img tag -->
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption>
{{ with (.Get "title") -}}
<h4>{{ . }}</h4>
{{- end -}}
{{- if or (.Get "caption") (.Get "attr") -}}<p>
{{- .Get "caption" | markdownify -}}
{{- with .Get "attrlink" }}
<a href="{{ . }}">
{{- end -}}
{{- .Get "attr" | markdownify -}}
{{- if .Get "attrlink" }}</a>{{ end }}</p>
{{- end }}
</figcaption>
{{- end }}
</figure>

View file

@ -8,15 +8,18 @@
{{ $translations := .AllTranslations }}
{{ with .File }}
{{ $path := .Path }}
{{range $translations}}
{{ range $translations }}
{{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }}
{{end}}
{{ end }}
{{ $id = delimit (slice "likes_" $path) "" }}
{{ end }}
{{ end }}
<span id="{{ $id }}"
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400"
title="likes">loading</span>
<span
id="{{ $id }}"
class="animate-pulse inline-block text-transparent max-h-3 rounded-full -mt-[2px] align-middle bg-neutral-300 dark:bg-neutral-400"
title="likes"
>loading</span
>
<span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span>
</span>
</span>

View file

@ -1,10 +1,14 @@
<span>
<button id="button_likes"
class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
onclick="process_article()">
<span id="button_likes_heart" style="display:none" class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }} </span>
<span id="button_likes_emtpty_heart" class="inline-block align-text-bottom">{{ partial "icon.html" "heart-empty" }}</span>
<span id="button_likes_text">&nbsp;Like</span>
</button>
<button
id="button_likes"
class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
<span id="button_likes_heart" class="inline-block align-text-bottom hidden"
>{{ partial "icon.html" "heart" }}
</span>
<span id="button_likes_emtpty_heart" class="inline-block align-text-bottom"
>{{ partial "icon.html" "heart-empty" }}</span
>
<span id="button_likes_text">&nbsp;Like</span>
</button>
</span>
{{- /* Trim EOF */ -}}
{{- /* Trim EOF */ -}}

View file

@ -8,13 +8,18 @@
{{ $translations := .AllTranslations }}
{{ with .File }}
{{ $path := .Path }}
{{range $translations}}
{{ range $translations }}
{{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }}
{{end}}
{{ end }}
{{ $id = delimit (slice "views_" $path) "" }}
{{ end }}
{{ end }}
<span id="{{ $id }}" class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="views">loading</span>
<span
id="{{ $id }}"
class="animate-pulse inline-block text-transparent max-h-3 rounded-full -mt-[2px] align-middle bg-neutral-300 dark:bg-neutral-400"
title="views"
>loading</span
>
<span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span>
</span>
</span>

View file

@ -1,14 +1,19 @@
{{ $jsZenMode := resources.Get "js/zen-mode.js" }}
{{ $jsZenMode = $jsZenMode | resources.Minify | resources.Fingerprint "sha512" }}
{{ $jsZenMode = $jsZenMode | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script type="text/javascript" src="{{ $jsZenMode.RelPermalink }}" integrity="{{ $jsZenMode.Data.Integrity }}"></script>
<script
type="text/javascript"
src="{{ $jsZenMode.RelPermalink }}"
integrity="{{ $jsZenMode.Data.Integrity }}"></script>
<span class="mb-[2px]">
<span id="zen-mode-button"
class="text-lg hover:text-primary-500"
title="{{ i18n "article.zen_mode_title.enable" }}"
data-title-i18n-disable="{{ i18n "article.zen_mode_title.enable" }}"
data-title-i18n-enable="{{ i18n "article.zen_mode_title.disable" }}">
<span class="inline-block align-text-bottom">{{ partial "icon.html" "expand" }}</span>
</span>
</span>
<span
id="zen-mode-button"
class="text-lg hover:text-primary-500"
title="{{ i18n "article.zen_mode_title.enable" }}"
data-title-i18n-disable="{{ i18n "article.zen_mode_title.enable" }}"
data-title-i18n-enable="{{ i18n "article.zen_mode_title.disable" }}">
<span class="inline-block align-text-bottom">{{ partial "icon.html" "expand" }}</span>
</span>
</span>

View file

@ -2,13 +2,14 @@
<ul class="flex flex-row mt-8 justify-center">
{{- .Scratch.Set "paginator.ellipsed" false -}}
{{ if $.Paginator.HasPrev }}
<li>
<a
<li>
<a
href="{{ $.Paginator.Prev.URL }}"
class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
rel="prev"
>&larr;</a>
</li>
>&larr;</a
>
</li>
{{ end }}
{{- range $.Paginator.Pagers -}}
{{- $right := sub .TotalPages .PageNumber -}}
@ -24,12 +25,13 @@
{{- if $showNumber -}}
<li>
<a
href="{{ .URL }}"
class="{{ if eq . $.Paginator }}
bg-primary-200 dark:bg-primary-400 dark:text-neutral-800
{{ end }} mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
>{{ .PageNumber }}</a>
</li>
href="{{ .URL }}"
class="{{ if eq . $.Paginator }}
bg-primary-200 dark:bg-primary-400 dark:text-neutral-800
{{ end }} mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
>{{ .PageNumber }}</a
>
</li>
{{- else if ($.Scratch.Get "paginator.shouldEllipse") -}}
<li class="page-item ">
<span class="page-link" aria-hidden="true">&hellip;</span>
@ -37,13 +39,14 @@
{{- end -}}
{{- end -}}
{{ if $.Paginator.HasNext }}
<li>
<a
<li>
<a
href="{{ $.Paginator.Next.URL }}"
class="mx-1 block min-w-[1.8rem] rounded text-center hover:bg-primary-600 hover:text-neutral"
rel="next"
>&rarr;</a>
</li>
>&rarr;</a
>
</li>
{{ end }}
</ul>
{{- end -}}
{{- end -}}

View file

@ -1,12 +1,13 @@
{{ $recentArticles := 5 }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
<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">
<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 first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
.Site.Params.mainSections)).Pages }}
{{ partial "article-link/card.html" . }}
.Site.Params.mainSections)).Pages
}}
{{ partial "article-link/card.html" . }}
{{ end }}
</section>
</div>
</div>

View file

@ -1,9 +1,11 @@
{{ $recentArticles := 5 }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
.Site.Params.mainSections)).Pages }}
{{ partial "article-link/card.html" . }}
.Site.Params.mainSections)).Pages
}}
{{ partial "article-link/card.html" . }}
{{ end }}
</section>
</section>

View file

@ -1,9 +1,9 @@
{{ $recentArticles := 5 }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
<section class="space-y-10 w-full">
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections)).Pages
}}
{{ partial "article-link/simple.html" . }}
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections)).Pages }}
{{ partial "article-link/simple.html" . }}
{{ end }}
</section>
</section>

View file

@ -1,30 +1,30 @@
{{ $recentArticles := 5 }}
{{ $showMoreLinkDest := "/posts/" }}
{{ if .Site.Params.homepage.showRecent | default false }}
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
{{ end }}
<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
{{ end }}
<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "shortcode.recent_articles" | emojify }}</h2>
{{ if and .Site.Params.homepage.cardView (not .Site.Params.homepage.cardViewScreenWidth) | default false }}
{{ partial "recent-articles/cardview.html" . }}
{{ else if and .Site.Params.homepage.cardView .Site.Params.homepage.cardViewScreenWidth | default false }}
{{ partial "recent-articles/cardview-fullwidth.html" . }}
{{ else }}
{{ partial "recent-articles/list.html" . }}
{{ end }}
{{ if and .Site.Params.homepage.cardView (not .Site.Params.homepage.cardViewScreenWidth) | default false }}
{{ partial "recent-articles/cardview.html" . }}
{{ else if and .Site.Params.homepage.cardView .Site.Params.homepage.cardViewScreenWidth | default false }}
{{ partial "recent-articles/cardview-fullwidth.html" . }}
{{ else }}
{{ partial "recent-articles/list.html" . }}
{{ end }}
{{ if .Site.Params.homepage.showMoreLink | default false }}
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }}
{{ end }}
<div class="mt-10 flex justify-center">
<a href="{{ $showMoreLinkDest }}">
<button
class="bg-transparent hover:text-primary-500 prose dark:prose-invert font-semibold hover:text-white py-2 px-4 border border-primary-500 hover:border-transparent rounded">
{{ i18n "recent.show_more" | markdownify }}
</button>
</a>
</div>
{{ end }}
{{ if .Site.Params.homepage.showMoreLink | default false }}
{{ if index .Site.Params.homepage "showRecentItems" }}
{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }}
{{ end }}
<div class="mt-10 flex justify-center">
<a href="{{ $showMoreLinkDest }}">
<button
class="bg-transparent hover:text-primary-500 prose dark:prose-invert font-semibold hover:text-white py-2 px-4 border border-primary-500 hover:border-transparent rounded">
{{ i18n "recent.show_more" | markdownify }}
</button>
</a>
</div>
{{ end }}
{{ end }}

View file

@ -1,11 +1,11 @@
{{ if .Params.showRelatedContent | default (.Site.Params.article.showRelatedContent | default false)}}
{{ $related := .Site.RegularPages.Related . | first .Site.Params.article.relatedContentLimit }}
{{ with $related }}
<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "article.related_articles" | emojify }}</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range . }}
{{ partial "article-link/card-related.html" . }}
{{ if .Params.showRelatedContent | default (.Site.Params.article.showRelatedContent | default false) }}
{{ $related := .Site.RegularPages.Related . | first .Site.Params.article.relatedContentLimit }}
{{ with $related }}
<h2 class="mt-8 text-2xl font-extrabold mb-10">{{ i18n "article.related_articles" | emojify }}</h2>
<section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3">
{{ range . }}
{{ partial "article-link/card-related.html" . }}
{{ end }}
</section>
{{ end }}
</section>
{{ end }}
{{ end }}

View file

@ -1,7 +1,9 @@
<div id="top-scroller" class="pointer-events-none absolute top-[110vh] bottom-0 w-12 ltr:right-0 rtl:left-0">
<a href="#the-top"
<a
href="#the-top"
class="pointer-events-auto sticky top-[calc(100vh-5.5rem)] flex h-12 w-12 mb-16 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
aria-label="{{ i18n "nav.scroll_to_top_title" }}" title="{{ i18n "nav.scroll_to_top_title" }}">
aria-label="{{ i18n "nav.scroll_to_top_title" }}"
title="{{ i18n "nav.scroll_to_top_title" }}">
&uarr;
</a>
</div>
</div>

View file

@ -1,13 +1,10 @@
<div
id="search-wrapper"
class="invisible fixed inset-0 flex h-screen w-screen cursor-default flex-col bg-neutral-500/50 p-4 backdrop-blur-sm dark:bg-neutral-900/50 sm:p-6 md:p-[10vh] lg:p-[12vh]"
data-url="{{ "" | absLangURL }}"
style="z-index:500"
>
class="invisible fixed inset-0 flex h-screen w-screen cursor-default flex-col bg-neutral-500/50 p-4 backdrop-blur-sm dark:bg-neutral-900/50 sm:p-6 md:p-[10vh] lg:p-[12vh] z-500"
data-url="{{ "" | absLangURL }}">
<div
id="search-modal"
class="flex flex-col w-full max-w-3xl min-h-0 mx-auto border rounded-md shadow-lg top-20 border-neutral-200 bg-neutral dark:border-neutral-700 dark:bg-neutral-800"
>
class="flex flex-col w-full max-w-3xl min-h-0 mx-auto border rounded-md shadow-lg top-20 border-neutral-200 bg-neutral dark:border-neutral-700 dark:bg-neutral-800">
<header class="relative z-10 flex items-center justify-between flex-none px-2">
<form class="flex items-center flex-auto min-w-0">
<div class="flex items-center justify-center w-8 h-8 text-neutral-400">
@ -18,14 +15,12 @@
id="search-query"
class="flex flex-auto h-12 mx-1 bg-transparent appearance-none focus:outline-dotted focus:outline-2 focus:outline-transparent"
placeholder="{{ i18n "search.input_placeholder" }}"
tabindex="0"
/>
tabindex="0">
</form>
<button
id="close-search-button"
class="flex items-center justify-center w-8 h-8 text-neutral-700 hover:text-primary-600 dark:text-neutral dark:hover:text-primary-400"
title="{{ i18n "search.close_button_title" }}"
>
title="{{ i18n "search.close_button_title" }}">
{{ partial "icon.html" "xmark" }}
</button>
</header>

View file

@ -1,5 +1,5 @@
{{ if .Params.series }}
<details style="margin-left:0px" class="mt-2 mb-5 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5">
<details class="mt-2 mb-5 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 ml-0">
{{ partial "series/series_base.html" . }}
</details>
{{end}}
</details>
{{ end }}

View file

@ -1,6 +1,7 @@
{{ if .Params.series }}
<details style="margin-left:0px" class="mt-2 mb-5 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5" {{
if .Params.seriesOpened | default (.Site.Params.article.seriesOpened | default false) }} open {{ end }}>
<details
class="mt-2 mb-5 overflow-hidden rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 ml-0"
{{ if .Params.seriesOpened | default (.Site.Params.article.seriesOpened | default false) }}open{{ end }}>
{{ partial "series/series_base.html" . }}
</details>
{{end}}
</details>
{{ end }}

View file

@ -1,22 +1,25 @@
{{ if .Params.series }}
<summary
class="py-1 text-lg font-semibold cursor-pointer bg-primary-200 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-primary-800 dark:text-neutral-100">
{{ index .Params.series 0 }} - {{ i18n "article.part_of_series" }}
</summary>
{{ $seriesName := strings.ToLower (index .Params.series 0) }}
{{ range $post := sort (index .Site.Taxonomies.series $seriesName) "Params.series_order" }}
<summary
class="py-1 text-lg font-semibold cursor-pointer bg-primary-200 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-primary-800 dark:text-neutral-100">
{{ index .Params.series 0 }} -
{{ i18n "article.part_of_series" }}
</summary>
{{ $seriesName := strings.ToLower (index .Params.series 0) }}
{{ range $post := sort (index .Site.Taxonomies.series $seriesName) "Params.series_order" }}
{{ if eq $post.Permalink $.Page.Permalink }}
<div
<div
class="py-1 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
{{ i18n "article.part" }} {{ $post.Params.series_order }}: {{ i18n "article.this_article" }}
</div>
{{ i18n "article.part" }} {{ $post.Params.series_order }}:
{{ i18n "article.this_article" }}
</div>
{{ else }}
<div
<div
class="py-1 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600">
<a href="{{$post.RelPermalink}}">
{{ i18n "article.part" }} {{ $post.Params.series_order }}: {{ $post.Params.title}}
<a href="{{ $post.RelPermalink }}">
{{ i18n "article.part" }} {{ $post.Params.series_order }}:
{{ $post.Params.title }}
</a>
</div>
{{end}}
{{end}}
{{end}}
</div>
{{ end }}
{{ end }}
{{ end }}

View file

@ -3,15 +3,14 @@
<section class="flex flex-row flex-wrap justify-center pt-4 text-xl">
{{ range . }}
{{ with index $links . }}
<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="{{ printf .url $.Permalink $.Title }}"
title="{{ i18n .title }}"
aria-label="{{ i18n .title }}"
>
{{ partial "icon.html" .icon }}
</a>
<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="{{ printf .url $.Permalink $.Title }}"
title="{{ i18n .title }}"
aria-label="{{ i18n .title }}">
{{ partial "icon.html" .icon }}
</a>
{{ end }}
{{ end }}
</section>

View file

@ -1,54 +1,51 @@
<a href="{{ .Page.RelPermalink }}" class="min-w-full">
<div
class="border border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative">
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{- with site.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}" />{{ end -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}">
{{ end -}}
{{- else -}}
{{- $images := .Page.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{- $images := .Page.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }}
{{- else -}}
{{- with site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}" />{{ end -}}
{{- else -}}
{{- with site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}">
{{ end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ if site.Params.taxonomy.showTermCount | default true }}
<span class="absolute bottom-0 right-0 m-2">
<span class="flex">
<span
class="rounded-md border border-primary-400 px-1 py-[1px] text-xl font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400"
>
{{ .Count }}
<span class="absolute bottom-0 right-0 m-2">
<span class="flex">
<span
class="rounded-md border border-primary-400 px-1 py-[1px] text-xl font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
{{ .Count }}
</span>
</span>
</span>
</span>
{{ end }}
<div class="px-6 py-4">
<div
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
>{{ .Page.Title | emojify }}</div>
</div>
<div class="px-6 pt-4 pb-2">
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
{{ .Page.Title | emojify }}
</div>
</div>
<div class="px-6 pt-4 pb-2"></div>
</div>
</a>
</a>

View file

@ -1,15 +1,15 @@
<article class="w-full px-2 my-3 overflow-hidden sm:w-1/2 md:w-1/3 lg:w-1/4 xl:w-1/4">
<h2 class="flex items-center">
<a
class="text-xl font-medium decoration-primary-500 hover:underline hover:underline-offset-2"
href="{{ .Page.RelPermalink }}"
>{{ .Page.Title }}</a
>
{{ if site.Params.taxonomy.showTermCount | default true }}
<span class="px-2 text-base text-primary-500">&middot;</span>
<span class="text-base text-neutral-400">
{{ .Count }}
</span>
{{ end }}
</h2>
</article>
<h2 class="flex items-center">
<a
class="text-xl font-medium decoration-primary-500 hover:underline hover:underline-offset-2"
href="{{ .Page.RelPermalink }}"
>{{ .Page.Title }}</a
>
{{ if site.Params.taxonomy.showTermCount | default true }}
<span class="px-2 text-base text-primary-500">&middot;</span>
<span class="text-base text-neutral-400">
{{ .Count }}
</span>
{{ end }}
</h2>
</article>

View file

@ -1,5 +1,7 @@
<details open id="TOCView"
class="toc-right mt-0 overflow-y-scroll overscroll-contain scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600 rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 hidden lg:block">
<details
open
id="TOCView"
class="toc-right mt-0 overflow-y-auto overscroll-contain scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600 rounded-lg ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 hidden lg:block">
<summary
class="block py-1 text-lg font-semibold cursor-pointer bg-neutral-100 text-neutral-800 ltr:-ml-5 ltr:pl-5 rtl:-mr-5 rtl:pr-5 dark:bg-neutral-700 dark:text-neutral-100 lg:hidden">
{{ i18n "article.table_of_contents" }}
@ -20,73 +22,86 @@
</div>
</details>
<script>
var margin = 200;
var marginError = 50;
(function () {
var $window = $(window);
var $toc = $('#TOCView');
var tocHeight = $toc.height();
function onResize() {
var windowAndMarginHeight = $window.height() - margin;
if(tocHeight >= windowAndMarginHeight) {
$toc.css("overflow-y", "scroll")
$toc.css("max-height", (windowAndMarginHeight + marginError) + "px")
} else {
$toc.css("overflow-y", "hidden")
$toc.css("max-height", "9999999px")
}
}
$window.on('resize', onResize);
$(document).ready(onResize);
})();
{{ if .Site.Params.smartTOC }}
<script>
(function () {
var $toc = $('#TableOfContents');
if ($toc.length > 0) {
var $window = $(window);
'use strict'
function onScroll() {
var currentScroll = $window.scrollTop();
var h = $('.anchor');
var id = "";
h.each(function (i, e) {
e = $(e);
if (e.offset().top - $(window).height()/3 <= currentScroll) {
id = decodeURIComponent(e.attr('id'));
}
});
var active = $toc.find('a.active');
if (active.length == 1 && active.eq(0).attr('href') == '#' + id) return true;
const SCROLL_OFFSET_RATIO = 0.33
const TOC_SELECTOR = '#TableOfContents'
const ANCHOR_SELECTOR = '.anchor'
const TOC_LINK_SELECTOR = 'a[href^="#"]'
const NESTED_LIST_SELECTOR = 'li ul'
const ACTIVE_CLASS = 'active'
active.each(function (i, e) {
{{ if .Site.Params.smartTOCHideUnfocusedChildren }}
$(e).removeClass('active').siblings('ul').hide();
{{ else }}
$(e).removeClass('active');
{{ end }}
});
$toc.find('a[href="#' + id + '"]').addClass('active')
$toc.find('a[href="#' + id + '"]').parentsUntil('#TableOfContents').each(function (i, e) {
$(e).children('a').parents('ul').show();
});
function getActiveAnchorId(anchors, offsetRatio) {
const threshold = window.scrollY + window.innerHeight * offsetRatio
const tocLinks = [...document.querySelectorAll('#TableOfContents a[href^="#"]')]
const tocIds = new Set(tocLinks.map(link => link.getAttribute('href').substring(1)))
for (let i = anchors.length - 1; i >= 0; i--) {
const top = anchors[i].getBoundingClientRect().top + window.scrollY
if (top <= threshold && tocIds.has(anchors[i].id)) {
return anchors[i].id
}
}
return anchors.find(anchor => tocIds.has(anchor.id))?.id || ''
}
function updateTOC({ toc, anchors, links, scrollOffset, collapseInactive }) {
const activeId = getActiveAnchorId(anchors, scrollOffset)
if (!activeId) return
links.forEach(link => {
const isActive = link.getAttribute('href') === `#${activeId}`
link.classList.toggle(ACTIVE_CLASS, isActive)
if (collapseInactive) {
const ul = link.closest('li')?.querySelector('ul')
if (ul) ul.style.display = isActive ? '' : 'none'
}
})
if (collapseInactive) {
const activeLink = toc.querySelector(`a[href="#${CSS.escape(activeId)}"]`)
let el = activeLink
while (el && el !== toc) {
if (el.tagName === 'UL') el.style.display = ''
if (el.tagName === 'LI') el.querySelector('ul')?.style.setProperty('display', '')
el = el.parentElement
}
}
}
function initTOC() {
const toc = document.querySelector(TOC_SELECTOR)
if (!toc) return
const collapseInactive = {{ if site.Params.smartTOCHideUnfocusedChildren }}true{{ else }}false{{ end }}
const anchors = [...document.querySelectorAll(ANCHOR_SELECTOR)]
const links = [...toc.querySelectorAll(TOC_LINK_SELECTOR)]
if (collapseInactive) {
toc.querySelectorAll(NESTED_LIST_SELECTOR).forEach(ul => ul.style.display = 'none')
}
$window.on('scroll', onScroll);
$(document).ready(function () {
{{ if .Site.Params.smartTOCHideUnfocusedChildren }}
$toc.find('a').parent('li').find('ul').hide();
{{ end }}
onScroll();
});
}
})();
{{ end }}
const config = {
toc,
anchors,
links,
scrollOffset: SCROLL_OFFSET_RATIO,
collapseInactive
}
window.addEventListener('scroll', () => updateTOC(config), { passive: true })
window.addEventListener('hashchange', () => updateTOC(config), { passive: true })
updateTOC(config)
}
document.readyState === 'loading'
? document.addEventListener('DOMContentLoaded', initTOC)
: initTOC()
})()
</script>
{{ end }}

View file

@ -1,25 +1,29 @@
{{ if .IsTranslated }}
<div>
<div class="cursor-pointer flex items-center nested-menu">
<span class="ltr:mr-1 rtl:ml-1">
{{ partial "icon.html" "language" }}
</span>
<div class="text-sm font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}">
{{- i18n "global.language" | markdownify -}}
<div>
<div class="cursor-pointer flex items-center nested-menu">
<span class="ltr:mr-1 rtl:ml-1">
{{ partial "icon.html" "language" }}
</span>
<div
class="text-sm font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"
title="{{ .Title }}">
{{- i18n "global.language" | markdownify -}}
</div>
</div>
</div>
<div class="absolute menuhide">
<div class="pt-2 p-5 mt-2 rounded-xl backdrop-blur shadow-2xl">
<div class="flex flex-col space-y-3">
{{ range .AllTranslations }}
<a href="{{ .RelPermalink }}" class="flex items-center">
<p class="text-sm font-sm text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}">
{{ .Language.Params.displayName | emojify }}
</p>
</a>
{{ end }}
<div class="absolute menuhide">
<div class="pt-2 p-5 mt-2 rounded-xl backdrop-blur shadow-2xl">
<div class="flex flex-col space-y-3">
{{ range .AllTranslations }}
<a href="{{ .RelPermalink }}" class="flex items-center">
<p
class="text-sm font-sm text-gray-500 hover:text-primary-600 dark:hover:text-primary-400"
title="{{ .Title }}">
{{ .Language.Params.displayName | emojify }}
</p>
</a>
{{ end }}
</div>
</div>
</div>
</div>
</div>
{{ end }}

View file

@ -1,5 +1,5 @@
{{/* jQuery */}}
{{ $jqueryLib := resources.Get "lib/jquery/jquery.slim.min.js" | resources.Fingerprint "sha512" }}
{{ $jqueryLib := resources.Get "lib/jquery/jquery.slim.min.js" | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script src="{{ $jqueryLib.RelPermalink }}" integrity="{{ $jqueryLib.Data.Integrity }}"></script>
{{/* Mermaid */}}
@ -7,69 +7,99 @@
{{ $mermaidLib := resources.Get "lib/mermaid/mermaid.min.js" }}
{{ $mermaidConfig := resources.Get "js/mermaid.js" }}
{{ $mermaidConfig := $mermaidConfig | resources.Minify }}
{{ $mermaidJS := slice $mermaidLib $mermaidConfig | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint "sha512" }}
{{ $mermaidJS := slice $mermaidLib $mermaidConfig | resources.Concat "js/mermaid.bundle.js" | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
defer
type="text/javascript"
src="{{ $mermaidJS.RelPermalink }}"
integrity="{{ $mermaidJS.Data.Integrity }}"
></script>
integrity="{{ $mermaidJS.Data.Integrity }}"></script>
{{ end }}
{{/* Chart */}}
{{ if .Page.HasShortcode "chart" }}
{{ $chartLib := resources.Get "lib/chart/chart.min.js" }}
{{ $chartConfig := resources.Get "js/chart.js" }}
{{ $chartConfig := $chartConfig | resources.Minify }}
{{ $chartJS := slice $chartLib $chartConfig | resources.Concat "js/chart.bundle.js" | resources.Fingerprint "sha512" }}
<script defer type="text/javascript" src="{{ $chartJS.RelPermalink }}"
integrity="{{ $chartJS.Data.Integrity }}"></script>
{{ $chartLib := resources.Get "lib/chart/chart.min.js" }}
{{ $chartConfig := resources.Get "js/chart.js" }}
{{ $chartConfig := $chartConfig | resources.Minify }}
{{ $chartJS := slice $chartLib $chartConfig | resources.Concat "js/chart.bundle.js" | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
defer
type="text/javascript"
src="{{ $chartJS.RelPermalink }}"
integrity="{{ $chartJS.Data.Integrity }}"></script>
{{ end }}
{{/* Katex */}}
{{ if .Page.HasShortcode "katex" }}
{{ $katexCSS := resources.Get "lib/katex/katex.min.css" }}
{{ $katexCSS := $katexCSS | resources.Fingerprint "sha512" }}
<link type="text/css" rel="stylesheet" href="{{ $katexCSS.RelPermalink }}" integrity="{{ $katexCSS.Data.Integrity }}" />
{{ $katexJS := resources.Get "lib/katex/katex.min.js" }}
{{ $katexJS := $katexJS | resources.Fingerprint "sha512" }}
<script defer src="{{ $katexJS.RelPermalink }}" integrity="{{ $katexJS.Data.Integrity }}"></script>
{{ $katexRenderJS := resources.Get "lib/katex/auto-render.min.js" }}
{{ $katexRenderJS := $katexRenderJS | resources.Fingerprint "sha512" }}
<script defer src="{{ $katexRenderJS.RelPermalink }}" integrity="{{ $katexRenderJS.Data.Integrity }}"
onload="renderMathInElement(document.body);"></script>
{{ $katexFonts := resources.Match "lib/katex/fonts/*" }}
{{ range $katexFonts }}
<!-- {{ .RelPermalink }} -->
{{ end }}
{{ $katexCSS := resources.Get "lib/katex/katex.min.css" }}
{{ $katexCSS := $katexCSS | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<link
type="text/css"
rel="stylesheet"
href="{{ $katexCSS.RelPermalink }}"
integrity="{{ $katexCSS.Data.Integrity }}">
{{ $katexLib := resources.Get "lib/katex/katex.min.js" }}
{{ $katexRenderLib := resources.Get "lib/katex/auto-render.min.js" }}
{{ $katexJS := slice $katexLib $katexRenderLib | resources.Concat "js/katex.bundle.js" | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
defer
type="text/javascript"
src="{{ $katexJS.RelPermalink }}"
integrity="{{ $katexJS.Data.Integrity }}"
id="katex-render"></script>
{{ $katexFonts := resources.Match "lib/katex/fonts/*" }}
{{ range $katexFonts }}
<!-- {{ .RelPermalink }} -->
{{ end }}
{{ end }}
{{/* TypeIt */}}
{{ if .Page.HasShortcode "typeit" }}
{{ $typeitLib := resources.Get "lib/typeit/typeit.umd.js" | resources.Fingerprint "sha512" }}
<script defer src="{{ $typeitLib.RelPermalink }}" integrity="{{ $typeitLib.Data.Integrity }}"></script>
{{ $typeitLib := resources.Get "lib/typeit/typeit.umd.js" | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script defer src="{{ $typeitLib.RelPermalink }}" integrity="{{ $typeitLib.Data.Integrity }}"></script>
{{ end }}
{{/* Packery */}}
{{ if .Page.HasShortcode "gallery" }}
{{ $packeryLib := resources.Get "lib/packery/packery.pkgd.min.js" }}
<script defer src="{{ $packeryLib.RelPermalink }}" integrity="{{ $packeryLib.Data.Integrity }}"></script>
{{ $packeryLib := resources.Get "lib/packery/packery.pkgd.min.js" }}
{{ $packeryLib = $packeryLib | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
defer
type="text/javascript"
src="{{ $packeryLib.RelPermalink }}"
integrity="{{ $packeryLib.Data.Integrity }}"></script>
{{ $jsShortcodeGallery := resources.Get "js/shortcodes/gallery.js" }}
{{ $jsShortcodeGallery = $jsShortcodeGallery | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsShortcodeGallery.RelPermalink }}" integrity="{{ $jsShortcodeGallery.Data.Integrity }}"></script>
{{ $jsShortcodeGallery := resources.Get "js/shortcodes/gallery.js" }}
{{ $jsShortcodeGallery = $jsShortcodeGallery | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $jsShortcodeGallery.RelPermalink }}"
integrity="{{ $jsShortcodeGallery.Data.Integrity }}"></script>
{{ end }}
{{/* tw-elements */}}
{{ if or (.Page.HasShortcode "carousel") (.Page.HasShortcode "timeline")}}
{{ $twelementsLib := resources.Get "lib/tw-elements/index.min.js" }}
<script defer src="{{ $twelementsLib.RelPermalink }}" integrity="{{ $twelementsLib.Data.Integrity }}"></script>
{{ if or (.Page.HasShortcode "carousel") (.Page.HasShortcode "timeline") }}
{{ $twelementsLib := resources.Get "lib/tw-elements/index.min.js" }}
{{ $twelementsLib = $twelementsLib | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
defer
type="text/javascript"
src="{{ $twelementsLib.RelPermalink }}"
integrity="{{ $twelementsLib.Data.Integrity }}"></script>
{{ end }}
{{/* youtubeLite */}}
{{ if .Page.HasShortcode "youtubeLite" }}
{{ $youtubeLiteJS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.js" | resources.Fingerprint "sha512" }}
{{ $youtubeLiteCSS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.css" }}
<link rel="stylesheet" href="{{ $youtubeLiteCSS.RelPermalink }}" integrity="{{ $youtubeLiteCSS.Data.Integrity }}"/>
<script src="{{ $youtubeLiteJS.RelPermalink }}" integrity="{{ $youtubeLiteJS.Data.Integrity }}"></script>
{{ $youtubeLiteCSS := resources.Get "lib/lite-youtube-embed/lite-yt-embed.css" }}
{{ $youtubeLiteCSS = $youtubeLiteCSS | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<link
type="text/css"
rel="stylesheet"
href="{{ $youtubeLiteCSS.RelPermalink }}"
integrity="{{ $youtubeLiteCSS.Data.Integrity }}">
{{ $youtubeLiteLib := resources.Get "lib/lite-youtube-embed/lite-yt-embed.js" }}
{{ $youtubeLiteLib = $youtubeLiteLib | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }}
<script
type="text/javascript"
src="{{ $youtubeLiteLib.RelPermalink }}"
integrity="{{ $youtubeLiteLib.Data.Integrity }}"></script>
{{ end }}