2021-08-21 01:42:40 +00:00
|
|
|
{{/* Determine the correct context and scope */}}
|
|
|
|
{{/* This allows for different logic depending on where the partial is called */}}
|
|
|
|
{{ $context := . }}
|
|
|
|
{{ $scope := default nil }}
|
|
|
|
|
|
|
|
{{ if (reflect.IsMap . ) }}
|
|
|
|
{{ $context = .context }}
|
|
|
|
{{ $scope = cond (not .scope) nil .scope }}
|
2021-08-14 04:44:34 +00:00
|
|
|
{{ end }}
|
2021-08-21 01:42:40 +00:00
|
|
|
|
|
|
|
{{ with $context }}
|
|
|
|
{{ $meta := newScratch }}
|
|
|
|
|
|
|
|
{{/* Gather partials for this context */}}
|
|
|
|
{{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
|
2022-01-23 19:28:50 +00:00
|
|
|
{{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }}
|
|
|
|
{{ end }}
|
|
|
|
|
2022-08-18 05:57:01 +00:00
|
|
|
{{ if and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial "functions/date.html" .Date) (partial "functions/date.html" .Lastmod)) }}
|
2022-01-23 19:28:50 +00:00
|
|
|
{{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }}
|
2021-08-21 01:42:40 +00:00
|
|
|
{{ end }}
|
|
|
|
|
2021-12-17 22:06:29 +00:00
|
|
|
{{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }}
|
2021-12-16 09:37:46 +00:00
|
|
|
{{ $meta.Add "partials" (slice (partial "meta/word-count.html" .)) }}
|
|
|
|
{{ end }}
|
|
|
|
|
2021-08-21 01:42:40 +00:00
|
|
|
{{ 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 (eq $scope "single") (.Params.showEdit | default (.Site.Params.article.showEdit | default false)) }}
|
|
|
|
{{ $meta.Add "partials" (slice (partial "meta/edit.html" .)) }}
|
|
|
|
{{ end }}
|
|
|
|
|
2023-04-05 00:50:15 +00:00
|
|
|
|
2022-01-23 22:14:13 +00:00
|
|
|
<div class="flex flex-row flex-wrap items-center">
|
2021-08-21 01:42:40 +00:00
|
|
|
{{/* Output partials */}}
|
|
|
|
{{ with ($meta.Get "partials") }}
|
2023-10-30 22:19:58 +00:00
|
|
|
{{ delimit . "<span class=\"px-2 text-primary-500\">·</span>" | safeHTML }}
|
2021-08-21 01:42:40 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{/* Output draft label */}}
|
|
|
|
{{ if and (eq $scope "single") (and .Draft .Site.Params.article.showDraftLabel) }}
|
2023-04-05 00:50:15 +00:00
|
|
|
<span class="ps-2">{{ partial "badge.html" (i18n "article.draft" | emojify) }}</span>
|
2021-08-21 01:42:40 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
2022-01-16 23:16:57 +00:00
|
|
|
|
|
|
|
{{/* Output taxonomies */}}
|
2022-10-20 05:34:18 +00:00
|
|
|
{{ if or
|
|
|
|
(and (ne $scope "single") (.Params.showTaxonomies | default (.Site.Params.list.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false))))
|
|
|
|
(and (eq $scope "single") (.Params.showTaxonomies | default (.Site.Params.article.showTaxonomies | default false)))
|
|
|
|
}}
|
2023-12-26 00:22:55 +00:00
|
|
|
<div class="flex flex-wrap my-1 text-xs leading-relaxed text-neutral-500 dark:text-neutral-400">
|
2022-01-16 23:16:57 +00:00
|
|
|
{{ range $taxonomy, $terms := .Site.Taxonomies }}
|
|
|
|
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
|
|
|
|
{{ range $context.GetTerms $taxonomy }}
|
|
|
|
<a
|
|
|
|
href="{{ .RelPermalink }}"
|
2023-10-17 07:39:33 +00:00
|
|
|
class="mx-1 my-1 rounded-md border border-neutral-200 px-1 py-[1px] hover:border-primary-300 hover:text-primary-700 dark:border-neutral-600 dark:hover:border-primary-600 dark:hover:text-primary-400"
|
2022-01-16 23:16:57 +00:00
|
|
|
>{{ .LinkTitle }}</a
|
|
|
|
>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2021-08-14 04:44:34 +00:00
|
|
|
{{ end }}
|