diff --git a/exampleSite/content/samples/placeholder-text.md b/exampleSite/content/samples/placeholder-text.md index f7ffc21c..3e8556ca 100755 --- a/exampleSite/content/samples/placeholder-text.md +++ b/exampleSite/content/samples/placeholder-text.md @@ -1,9 +1,11 @@ --- title: "Placeholder Text" date: "2019-03-09" +lastmod: "2022-01-24" draft: true description: "Lorem Ipsum Dolor Si Amet" tags: ["markdown", "text", "sample", "latin"] +showDateUpdated: true xml: false --- 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/tr.yaml b/i18n/tr.yaml index 37f20a4c..e6c4f51d 100644 --- a/i18n/tr.yaml +++ b/i18n/tr.yaml @@ -6,6 +6,7 @@ article: one: "{{ .Count }} dk" other: "{{ .Count }} dk" reading_time_title: "Okuma süresi" + # updated: "Updated" word_count: one: "{{ .Count }} kelime" other: "{{ .Count }} kelime" 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 }} 字" diff --git a/layouts/partials/article-meta.html b/layouts/partials/article-meta.html index ea87e653..7149f76a 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) }} @@ -29,7 +33,7 @@ {{ end }} -
+
{{/* Output partials */}} {{ with ($meta.Get "partials") }} {{ delimit . "·" }} diff --git a/layouts/partials/article-pagination.html b/layouts/partials/article-pagination.html index f4b323a5..3d57444b 100644 --- a/layouts/partials/article-pagination.html +++ b/layouts/partials/article-pagination.html @@ -13,7 +13,7 @@ > {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }} - {{ partial "meta/date.html" .NextInSection }} + {{ partial "meta/date.html" .NextInSection.Date }} {{ end }} @@ -29,7 +29,7 @@ > {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }} - {{ partial "meta/date.html" .PrevInSection }} + {{ partial "meta/date.html" .PrevInSection.Date }} {{ end }} 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..3827ad3e 100644 --- a/layouts/partials/meta/date.html +++ b/layouts/partials/meta/date.html @@ -1,11 +1,4 @@ -