Date: Fri, 21 Jan 2022 13:28:25 -0500
Subject: [PATCH 07/27] Add option to add word count to metadata (#740)
Usage:
ShowWordCount: true
---
i18n/de.yaml | 5 +++++
i18n/en.yaml | 5 +++++
i18n/es.yaml | 7 ++++++-
i18n/fr.yaml | 5 +++++
i18n/it.yaml | 5 +++++
i18n/nl.yaml | 5 +++++
i18n/pt.yaml | 5 +++++
layouts/partials/post_meta.html | 4 ++++
8 files changed, 40 insertions(+), 1 deletion(-)
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 }}
From d52bced73599a6efaf66a8d843bda0380e378ed7 Mon Sep 17 00:00:00 2001
From: yuyin <38490578+yuyinws@users.noreply.github.com>
Date: Sat, 22 Jan 2022 02:29:36 +0800
Subject: [PATCH 08/27] complete simplified/traditional Chinese (#756)
---
i18n/zh-tw.yaml | 3 +++
i18n/zh.yaml | 3 +++
2 files changed, 6 insertions(+)
diff --git a/i18n/zh-tw.yaml b/i18n/zh-tw.yaml
index f6dee2d..c6b0e7f 100644
--- a/i18n/zh-tw.yaml
+++ b/i18n/zh-tw.yaml
@@ -18,6 +18,9 @@
- id: home
translation: "首頁"
+- id: edit_post
+ translation: "編輯"
+
- id: code_copy
translation: "複製"
diff --git a/i18n/zh.yaml b/i18n/zh.yaml
index 006528b..7f15ab0 100644
--- a/i18n/zh.yaml
+++ b/i18n/zh.yaml
@@ -18,6 +18,9 @@
- id: home
translation: "主页"
+- id: edit_post
+ translation: "编辑"
+
- id: code_copy
translation: "复制"
From 530044033e8a9d87d5297b936e37cbfb2b5562e3 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Sat, 22 Jan 2022 00:25:35 +0530
Subject: [PATCH 09/27] Add `UseHugoToc` so that Hugo's default ToC can be
used.
Usage =>
UseHugoToc: true
closes: #747
---
layouts/partials/toc.html | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index 7a4c019..d9b8b23 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -8,6 +8,9 @@
+ {{- if (.Param "UseHugoToc") }}
+ {{- .TableOfContents -}}
+ {{- else }}
{{- $largest := 6 -}}
{{- range $headers -}}
{{- $headerLevel := index (findRE "[1-6]" . 1) 0 -}}
@@ -87,6 +90,7 @@
{{- end -}}
{{- end }}
+ {{- end }}