🔀 Merge pull request #786 from pomeloy/features

Do not render article-meta figure if there is nothing to display
pull/792/head
James Panther 2024-01-21 14:27:23 +11:00 committed by GitHub
commit 3ce38cc6f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 3 deletions

View File

@ -10,9 +10,17 @@
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral"> <h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
{{ .Title | emojify }} {{ .Title | emojify }}
</h1> </h1>
<div class="mb-12 mt-8 text-base text-neutral-500 print:hidden dark:text-neutral-400"> {{ if or
{{ partial "article-meta.html" (dict "context" . "scope" "single") }} (.Params.showDate | default (.Site.Params.article.showDate | default true))
</div> (and (.Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false)) (ne (partial "functions/date.html" .Date) (partial "functions/date.html" .Lastmod)))
(and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0))
(and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0))
(.Params.showEdit | default (.Site.Params.article.showEdit | default false))
}}
<div class="mb-12 mt-8 text-base text-neutral-500 print:hidden dark:text-neutral-400">
{{ partial "article-meta.html" (dict "context" . "scope" "single") }}
</div>
{{ end }}
{{ with $feature }} {{ with $feature }}
<div class="prose"> <div class="prose">
{{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }} {{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}