From 043a1c1972d02b239921b3f60e32d6591cf8a7ac Mon Sep 17 00:00:00 2001 From: Ress <48500247+ress997@users.noreply.github.com> Date: Fri, 9 Oct 2020 13:34:41 +0900 Subject: [PATCH 1/3] Be able to display last update time --- i18n/en.toml | 2 +- i18n/zh-CN.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/i18n/en.toml b/i18n/en.toml index 7f2036e..9bd57b6 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -5,7 +5,7 @@ other = "Related contents" [lastUpdatedOn] - other ="Last updated on {{ .Count }}" + other ="Last updated on {{ . }}" [widgetArchivesTitle] other = "Archives" diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index d8852e4..b0f56d6 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -5,7 +5,7 @@ other = "相关文章" [lastUpdatedOn] - other ="最后更新于 {{ .Count }}" + other ="最后更新于 {{ . }}" [widgetArchivesTitle] other = "归档" From 8d508fb7968206113e80ef6abb88af69aa7166da Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Fri, 9 Oct 2020 19:01:37 +0200 Subject: [PATCH 2/3] refactor(i18n/article): remove date variable from lastUpdatedOn item Due to Hugo v0.76's i18n behaviour change --- i18n/en.toml | 2 +- i18n/zh-CN.toml | 2 +- layouts/partials/article/components/footer.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/en.toml b/i18n/en.toml index 9bd57b6..f766971 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -5,7 +5,7 @@ other = "Related contents" [lastUpdatedOn] - other ="Last updated on {{ . }}" + other ="Last updated on" [widgetArchivesTitle] other = "Archives" diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml index b0f56d6..a3f78cd 100644 --- a/i18n/zh-CN.toml +++ b/i18n/zh-CN.toml @@ -5,7 +5,7 @@ other = "相关文章" [lastUpdatedOn] - other ="最后更新于 {{ . }}" + other ="最后更新于" [widgetArchivesTitle] other = "归档" diff --git a/layouts/partials/article/components/footer.html b/layouts/partials/article/components/footer.html index 3431c81..7f42870 100644 --- a/layouts/partials/article/components/footer.html +++ b/layouts/partials/article/components/footer.html @@ -12,7 +12,7 @@
{{ (resources.Get "icons/clock.svg").Content | safeHTML }} - {{ T "lastUpdatedOn" (.Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" )) }} + {{ T "lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
{{- end -}} From b3a4f3b156f85e274cbe25aaf29a37d3a705190f Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Fri, 9 Oct 2020 19:03:56 +0200 Subject: [PATCH 3/3] doc(exampleSite): add lastmod field to about page To test last updated output --- exampleSite/content/page/about.md | 1 + 1 file changed, 1 insertion(+) diff --git a/exampleSite/content/page/about.md b/exampleSite/content/page/about.md index 46a3b3e..8a8789f 100644 --- a/exampleSite/content/page/about.md +++ b/exampleSite/content/page/about.md @@ -5,6 +5,7 @@ date = "2019-02-28" aliases = ["about-us", "about-hugo", "contact"] author = "Hugo Authors" license = "CC BY-NC-ND" +lastmod = "2020-10-09" +++ Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.