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" one: "1 Minute"
other: "{{ .Count }} Minuten" other: "{{ .Count }} Minuten"
- id: words
translation:
one : "Wort"
other: "{{ .Count }} Wörter"
- id: toc - id: toc
translation: "Inhaltsverzeichnis" translation: "Inhaltsverzeichnis"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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