Add option to add word count to metadata (#740)

Usage: 
ShowWordCount: true
This commit is contained in:
Thiago Perrotta 2022-01-21 13:28:25 -05:00 committed by GitHub
parent 37f359ee21
commit b0ab8ea495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 1 deletions

View File

@ -9,6 +9,11 @@
one: "1 Minute"
other: "{{ .Count }} Minuten"
- id: words
translation:
one : "Wort"
other: "{{ .Count }} Wörter"
- id: toc
translation: "Inhaltsverzeichnis"

View File

@ -9,6 +9,11 @@
one : "1 min"
other: "{{ .Count }} min"
- id: words
translation:
one : "word"
other: "{{ .Count }} words"
- id: toc
translation: "Table of Contents"

View File

@ -9,6 +9,11 @@
one : "1 min"
other: "{{ .Count }} min"
- id: words
translation:
one : "palabra"
other: "{{ .Count }} palabras"
- id: toc
translation: "Tabla de Contenidos"
@ -25,4 +30,4 @@
translation: "copiar"
- id: code_copied
translation: "¡copiado!"
translation: "¡copiado!"

View File

@ -9,6 +9,11 @@
one : "1 min"
other: "{{ .Count }} min"
- id: words
translation:
one : "mot"
other: "{{ .Count }} mots"
- id: toc
translation: "Table des Matières"

View File

@ -9,6 +9,11 @@
one: "1 minuto"
other: "{{ .Count }} minuti"
- id: words
translation:
one : "parola"
other: "{{ .Count }} parole"
- id: toc
translation: "Tabella dei Contenuti"

View File

@ -9,6 +9,11 @@
one: "1 min"
other: "{{ .Count }} min"
- id: words
translation:
one : "woord"
other: "{{ .Count }} woorden"
- id: toc
translation: "Inhoudsopgave"

View File

@ -9,6 +9,11 @@
one: "1 minuto"
other: "{{ .Count }} minutos"
- id: words
translation:
one : "palavra"
other: "{{ .Count }} palavras"
- id: toc
translation: "Conteúdo"

View File

@ -8,6 +8,10 @@
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }}
{{- end }}
{{- if (.Param "ShowWordCount") -}}
{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }}
{{- end }}
{{- with (partial "author.html" .) }}
{{- $scratch.Add "meta" (slice .) }}
{{- end }}