Skip to content

Commit 1521cc7

Browse files
authored
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 `<meta name="author">`. So add hideAuthor
1 parent 6f29d35 commit 1521cc7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

layouts/partials/post_meta.html

+2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }}
1313
{{- end }}
1414

15+
{{- if not (.Param "hideAuthor") -}}
1516
{{- with (partial "author.html" .) }}
1617
{{- $scratch.Add "meta" (slice .) }}
1718
{{- end }}
19+
{{- end }}
1820

1921
{{- with ($scratch.Get "meta") }}
2022
{{- delimit . "&nbsp;·&nbsp;" -}}

0 commit comments

Comments
 (0)