🔀 Merge pull request #57 from wizardbyron/dev

Add word count to page meta
pull/61/head
James Panther 2021-12-18 08:58:48 +11:00 committed by GitHub
commit 27ccae6f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 28 additions and 0 deletions

View File

@ -30,6 +30,7 @@ colorScheme = "congo"
showPagination = true
showReadingTime = true
# sharingLinks = ["facebook", "twitter", "pinterest", "reddit", "linkedin", "email"]
showWordCount = true
[list]
showBreadcrumbs = false

View File

@ -6,6 +6,9 @@ article:
one: "{{ .Count }} min"
other: "{{ .Count }} min"
reading_time_title: "Lesezeit"
# word_count:
# one: "{{ .Count }} word"
# other: "{{ .Count }} words"
author:
byline_title: "Autor"

View File

@ -6,6 +6,9 @@ article:
one: "{{ .Count }} min"
other: "{{ .Count }} mins"
reading_time_title: "Reading time"
word_count:
one: "{{ .Count }} word"
other: "{{ .Count }} words"
author:
byline_title: "Author"

View File

@ -6,6 +6,9 @@ article:
one: "{{ .Count }} min"
other: "{{ .Count }} mins"
reading_time_title: "Tiempo de lectura"
# word_count:
# one: "{{ .Count }} word"
# other: "{{ .Count }} words"
author:
byline_title: "Autor"

View File

@ -6,6 +6,9 @@ article:
one: "{{ .Count }} min"
other: "{{ .Count }} mins"
reading_time_title: "Temps de lecture"
# word_count:
# one: "{{ .Count }} word"
# other: "{{ .Count }} words"
author:
byline_title: "Auteur"

View File

@ -6,6 +6,9 @@ article:
one: "{{ .Count }} minuto"
other: "{{ .Count }} minutos"
reading_time_title: "Tempo de leitura"
# word_count:
# one: "{{ .Count }} word"
# other: "{{ .Count }} words"
author:
byline_title: "Autor"

View File

@ -5,6 +5,9 @@ article:
reading_time:
other: "{{ .Count }} 分钟"
reading_time_title: "预计阅读"
word_count:
one: "{{ .Count }} 字"
other: "{{ .Count }} 字"
author:
byline_title: "作者"

View File

@ -16,6 +16,10 @@
{{ $meta.Add "partials" (slice (partial "meta/date.html" .)) }}
{{ end }}
{{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default true)) (ne .WordCount 0) }}
{{ $meta.Add "partials" (slice (partial "meta/word-count.html" .)) }}
{{ end }}
{{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0) }}
{{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
{{ end }}

View File

@ -0,0 +1,5 @@
<span>
{{- i18n "article.word_count" .WordCount | emojify -}}
</span>
{{- /* Trim EOF */ -}}