Skip to content

Commit b0ab8ea

Browse files
authored
Add option to add word count to metadata (#740)
Usage: ShowWordCount: true
1 parent 37f359e commit b0ab8ea

File tree

8 files changed

+40
-1
lines changed

8 files changed

+40
-1
lines changed

i18n/de.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
one: "1 Minute"
1010
other: "{{ .Count }} Minuten"
1111

12+
- id: words
13+
translation:
14+
one : "Wort"
15+
other: "{{ .Count }} Wörter"
16+
1217
- id: toc
1318
translation: "Inhaltsverzeichnis"
1419

i18n/en.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
one : "1 min"
1010
other: "{{ .Count }} min"
1111

12+
- id: words
13+
translation:
14+
one : "word"
15+
other: "{{ .Count }} words"
16+
1217
- id: toc
1318
translation: "Table of Contents"
1419

i18n/es.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
one : "1 min"
1010
other: "{{ .Count }} min"
1111

12+
- id: words
13+
translation:
14+
one : "palabra"
15+
other: "{{ .Count }} palabras"
16+
1217
- id: toc
1318
translation: "Tabla de Contenidos"
1419

@@ -25,4 +30,4 @@
2530
translation: "copiar"
2631

2732
- id: code_copied
28-
translation: "¡copiado!"
33+
translation: "¡copiado!"

i18n/fr.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
one : "1 min"
1010
other: "{{ .Count }} min"
1111

12+
- id: words
13+
translation:
14+
one : "mot"
15+
other: "{{ .Count }} mots"
16+
1217
- id: toc
1318
translation: "Table des Matières"
1419

i18n/it.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
one: "1 minuto"
1010
other: "{{ .Count }} minuti"
1111

12+
- id: words
13+
translation:
14+
one : "parola"
15+
other: "{{ .Count }} parole"
16+
1217
- id: toc
1318
translation: "Tabella dei Contenuti"
1419

i18n/nl.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
one: "1 min"
1010
other: "{{ .Count }} min"
1111

12+
- id: words
13+
translation:
14+
one : "woord"
15+
other: "{{ .Count }} woorden"
16+
1217
- id: toc
1318
translation: "Inhoudsopgave"
1419

i18n/pt.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
one: "1 minuto"
1010
other: "{{ .Count }} minutos"
1111

12+
- id: words
13+
translation:
14+
one : "palavra"
15+
other: "{{ .Count }} palavras"
16+
1217
- id: toc
1318
translation: "Conteúdo"
1419

layouts/partials/post_meta.html

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }}
99
{{- end }}
1010

11+
{{- if (.Param "ShowWordCount") -}}
12+
{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }}
13+
{{- end }}
14+
1115
{{- with (partial "author.html" .) }}
1216
{{- $scratch.Add "meta" (slice .) }}
1317
{{- end }}

0 commit comments

Comments
 (0)