From 850fc65b1b446c3186f23ea26de251e04d398c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Bele=C3=B1a?= Date: Sun, 23 Jan 2022 20:16:07 +0100 Subject: [PATCH 1/7] :globe_with_meridians: Add i18n 'Updated' strings --- i18n/de.yaml | 1 + i18n/en.yaml | 1 + i18n/es.yaml | 7 ++++--- i18n/fr.yaml | 1 + i18n/pt-BR.yaml | 1 + i18n/zh.yaml | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/i18n/de.yaml b/i18n/de.yaml index 631707bd..9faf2701 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -6,6 +6,7 @@ article: one: "{{ .Count }} min" other: "{{ .Count }} min" reading_time_title: "Lesezeit" + # updated: "Updated" # word_count: # one: "{{ .Count }} word" # other: "{{ .Count }} words" diff --git a/i18n/en.yaml b/i18n/en.yaml index 6cb5c3d5..2decbca4 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -6,6 +6,7 @@ article: one: "{{ .Count }} min" other: "{{ .Count }} mins" reading_time_title: "Reading time" + updated: "Updated" word_count: one: "{{ .Count }} word" other: "{{ .Count }} words" diff --git a/i18n/es.yaml b/i18n/es.yaml index c8afbc09..a38db533 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -6,9 +6,10 @@ article: one: "{{ .Count }} min" other: "{{ .Count }} mins" reading_time_title: "Tiempo de lectura" - # word_count: - # one: "{{ .Count }} word" - # other: "{{ .Count }} words" + updated: "Actualizado" + word_count: + one: "{{ .Count }} palabra" + other: "{{ .Count }} palabras" author: byline_title: "Autor" diff --git a/i18n/fr.yaml b/i18n/fr.yaml index b3078535..e0ab669e 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -6,6 +6,7 @@ article: one: "{{ .Count }} min" other: "{{ .Count }} mins" reading_time_title: "Temps de lecture" + # updated: "Updated" # word_count: # one: "{{ .Count }} word" # other: "{{ .Count }} words" diff --git a/i18n/pt-BR.yaml b/i18n/pt-BR.yaml index 2396bc7b..651182f1 100644 --- a/i18n/pt-BR.yaml +++ b/i18n/pt-BR.yaml @@ -6,6 +6,7 @@ article: one: "{{ .Count }} minuto" other: "{{ .Count }} minutos" reading_time_title: "Tempo de leitura" + # updated: "Updated" # word_count: # one: "{{ .Count }} word" # other: "{{ .Count }} words" diff --git a/i18n/zh.yaml b/i18n/zh.yaml index ec93aa7e..1cd3616f 100644 --- a/i18n/zh.yaml +++ b/i18n/zh.yaml @@ -5,6 +5,7 @@ article: reading_time: other: "{{ .Count }} 分钟" reading_time_title: "预计阅读" + # updated: "Updated" word_count: one: "{{ .Count }} 字" other: "{{ .Count }} 字" From c9bb4b0b6314d6d40a896e68ebfacff9df92c87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Bele=C3=B1a?= Date: Sun, 23 Jan 2022 20:28:50 +0100 Subject: [PATCH 2/7] :lipstick: Adjust metadata output --- layouts/partials/article-meta.html | 6 +++++- layouts/partials/meta/date-updated.html | 3 +++ layouts/partials/meta/date.html | 11 ++--------- 3 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 layouts/partials/meta/date-updated.html diff --git a/layouts/partials/article-meta.html b/layouts/partials/article-meta.html index ea87e653..ed0eca75 100644 --- a/layouts/partials/article-meta.html +++ b/layouts/partials/article-meta.html @@ -13,7 +13,11 @@ {{/* Gather partials for this context */}} {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }} - {{ $meta.Add "partials" (slice (partial "meta/date.html" .)) }} + {{ $meta.Add "partials" (slice (partial "meta/date.html" .Date)) }} + {{ end }} + + {{ if .Params.showDateUpdated | default (.Site.Params.article.showDateUpdated | default false) }} + {{ $meta.Add "partials" (slice (partial "meta/date-updated.html" .Lastmod)) }} {{ end }} {{ if and (.Params.showWordCount | default (.Site.Params.article.showWordCount | default false)) (ne .WordCount 0) }} diff --git a/layouts/partials/meta/date-updated.html b/layouts/partials/meta/date-updated.html new file mode 100644 index 00000000..367486f4 --- /dev/null +++ b/layouts/partials/meta/date-updated.html @@ -0,0 +1,3 @@ +{{- i18n "article.updated" -}}:  +{{ partial "meta/date.html" . }} +{{- /* Trim EOF */ -}} diff --git a/layouts/partials/meta/date.html b/layouts/partials/meta/date.html index 92c2675b..c6687972 100644 --- a/layouts/partials/meta/date.html +++ b/layouts/partials/meta/date.html @@ -1,11 +1,4 @@ -