mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-01 04:21:55 -04:00
✨ Add word count to page meta
This commit is contained in:
committed by
James Panther
parent
24ce98d1f2
commit
65a7228bfc
@@ -30,6 +30,7 @@ colorScheme = "congo"
|
||||
showPagination = true
|
||||
showReadingTime = true
|
||||
# sharingLinks = ["facebook", "twitter", "pinterest", "reddit", "linkedin", "email"]
|
||||
showWordCount = true
|
||||
|
||||
[list]
|
||||
showBreadcrumbs = false
|
||||
|
||||
@@ -6,6 +6,7 @@ article:
|
||||
one: "{{ .Count }} min"
|
||||
other: "{{ .Count }} mins"
|
||||
reading_time_title: "Reading time"
|
||||
word_count_unit: "Words"
|
||||
|
||||
author:
|
||||
byline_title: "Author"
|
||||
|
||||
@@ -5,6 +5,7 @@ article:
|
||||
reading_time:
|
||||
other: "{{ .Count }} 分钟"
|
||||
reading_time_title: "预计阅读"
|
||||
word_count_unit: "字"
|
||||
|
||||
author:
|
||||
byline_title: "作者"
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<span>
|
||||
{{ .WordCount }} {{- i18n "article.word_count_unit" -}}
|
||||
</span>
|
||||
{{- /* Trim EOF */ -}}
|
||||
|
||||
Reference in New Issue
Block a user