mirror of https://github.com/jpanther/congo.git
✨ Add word count to page meta
parent
24ce98d1f2
commit
65a7228bfc
|
@ -30,6 +30,7 @@ colorScheme = "congo"
|
||||||
showPagination = true
|
showPagination = true
|
||||||
showReadingTime = true
|
showReadingTime = true
|
||||||
# sharingLinks = ["facebook", "twitter", "pinterest", "reddit", "linkedin", "email"]
|
# sharingLinks = ["facebook", "twitter", "pinterest", "reddit", "linkedin", "email"]
|
||||||
|
showWordCount = true
|
||||||
|
|
||||||
[list]
|
[list]
|
||||||
showBreadcrumbs = false
|
showBreadcrumbs = false
|
||||||
|
|
|
@ -6,6 +6,7 @@ article:
|
||||||
one: "{{ .Count }} min"
|
one: "{{ .Count }} min"
|
||||||
other: "{{ .Count }} mins"
|
other: "{{ .Count }} mins"
|
||||||
reading_time_title: "Reading time"
|
reading_time_title: "Reading time"
|
||||||
|
word_count_unit: "Words"
|
||||||
|
|
||||||
author:
|
author:
|
||||||
byline_title: "Author"
|
byline_title: "Author"
|
||||||
|
|
|
@ -5,6 +5,7 @@ article:
|
||||||
reading_time:
|
reading_time:
|
||||||
other: "{{ .Count }} 分钟"
|
other: "{{ .Count }} 分钟"
|
||||||
reading_time_title: "预计阅读"
|
reading_time_title: "预计阅读"
|
||||||
|
word_count_unit: "字"
|
||||||
|
|
||||||
author:
|
author:
|
||||||
byline_title: "作者"
|
byline_title: "作者"
|
||||||
|
|
|
@ -16,6 +16,10 @@
|
||||||
{{ $meta.Add "partials" (slice (partial "meta/date.html" .)) }}
|
{{ $meta.Add "partials" (slice (partial "meta/date.html" .)) }}
|
||||||
{{ end }}
|
{{ 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) }}
|
{{ if and (.Params.showReadingTime | default (.Site.Params.article.showReadingTime | default true)) (ne .ReadingTime 0) }}
|
||||||
{{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
|
{{ $meta.Add "partials" (slice (partial "meta/reading-time.html" .)) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<span>
|
||||||
|
{{ .WordCount }} {{- i18n "article.word_count_unit" -}}
|
||||||
|
</span>
|
||||||
|
{{- /* Trim EOF */ -}}
|
||||||
|
|
Loading…
Reference in New Issue