summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Perrotta <tbperrotta@gmail.com>2022-01-21 13:28:25 -0500
committerGitHub <noreply@github.com>2022-01-21 23:58:25 +0530
commitb0ab8ea4959c07fe13c1667297e986e1d65aafe1 (patch)
treeb0da1d5130c06f2e3733ef64660cd4dea284d843
parent37f359ee2149abe147bba0a7dd4e1ff775dc2a56 (diff)
Add option to add word count to metadata (#740)
Usage: ShowWordCount: true
-rw-r--r--i18n/de.yaml5
-rw-r--r--i18n/en.yaml5
-rw-r--r--i18n/es.yaml7
-rw-r--r--i18n/fr.yaml5
-rw-r--r--i18n/it.yaml5
-rw-r--r--i18n/nl.yaml5
-rw-r--r--i18n/pt.yaml5
-rw-r--r--layouts/partials/post_meta.html4
8 files changed, 40 insertions, 1 deletions
diff --git a/i18n/de.yaml b/i18n/de.yaml
index 9a816e4..4725419 100644
--- a/i18n/de.yaml
+++ b/i18n/de.yaml
@@ -9,6 +9,11 @@
one: "1 Minute"
other: "{{ .Count }} Minuten"
+- id: words
+ translation:
+ one : "Wort"
+ other: "{{ .Count }} Wörter"
+
- id: toc
translation: "Inhaltsverzeichnis"
diff --git a/i18n/en.yaml b/i18n/en.yaml
index 4758d36..3dc1579 100644
--- a/i18n/en.yaml
+++ b/i18n/en.yaml
@@ -9,6 +9,11 @@
one : "1 min"
other: "{{ .Count }} min"
+- id: words
+ translation:
+ one : "word"
+ other: "{{ .Count }} words"
+
- id: toc
translation: "Table of Contents"
diff --git a/i18n/es.yaml b/i18n/es.yaml
index 5e90ebb..163bfc4 100644
--- a/i18n/es.yaml
+++ b/i18n/es.yaml
@@ -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!" \ No newline at end of file
+ translation: "¡copiado!"
diff --git a/i18n/fr.yaml b/i18n/fr.yaml
index 2e65211..46ad398 100644
--- a/i18n/fr.yaml
+++ b/i18n/fr.yaml
@@ -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"
diff --git a/i18n/it.yaml b/i18n/it.yaml
index 58de606..ef41db4 100644
--- a/i18n/it.yaml
+++ b/i18n/it.yaml
@@ -9,6 +9,11 @@
one: "1 minuto"
other: "{{ .Count }} minuti"
+- id: words
+ translation:
+ one : "parola"
+ other: "{{ .Count }} parole"
+
- id: toc
translation: "Tabella dei Contenuti"
diff --git a/i18n/nl.yaml b/i18n/nl.yaml
index 63a9931..e9d06fa 100644
--- a/i18n/nl.yaml
+++ b/i18n/nl.yaml
@@ -9,6 +9,11 @@
one: "1 min"
other: "{{ .Count }} min"
+- id: words
+ translation:
+ one : "woord"
+ other: "{{ .Count }} woorden"
+
- id: toc
translation: "Inhoudsopgave"
diff --git a/i18n/pt.yaml b/i18n/pt.yaml
index b30e429..f449de9 100644
--- a/i18n/pt.yaml
+++ b/i18n/pt.yaml
@@ -9,6 +9,11 @@
one: "1 minuto"
other: "{{ .Count }} minutos"
+- id: words
+ translation:
+ one : "palavra"
+ other: "{{ .Count }} palavras"
+
- id: toc
translation: "Conteúdo"
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html
index 9225f13..f7134fb 100644
--- a/layouts/partials/post_meta.html
+++ b/layouts/partials/post_meta.html
@@ -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 }}