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