From 1521cc77a27e5c2fc7026707450a165675dc9025 Mon Sep 17 00:00:00 2001 From: Rook1e Date: Sat, 5 Aug 2023 14:22:30 +0800 Subject: [PATCH] feat: allow hiding author in post_meta (#1250) * feat: allow hiding author in post_meta For a person's site, in most cases the author is the person, and displaying it on every post and list may be redundant. Setting the `params.author` in the configuration to empty will achieve the hidden effect, but it will also empty the value of ``. So add hideAuthor --- layouts/partials/post_meta.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html index 15b8b1b..8bc0e50 100644 --- a/layouts/partials/post_meta.html +++ b/layouts/partials/post_meta.html @@ -12,9 +12,11 @@ {{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} {{- end }} +{{- if not (.Param "hideAuthor") -}} {{- with (partial "author.html" .) }} {{- $scratch.Add "meta" (slice .) }} {{- end }} +{{- end }} {{- with ($scratch.Get "meta") }} {{- delimit . " ยท " -}}