diff options
author | thingsym <thingsym@gmail.com> | 2019-04-27 11:55:22 +0300 |
---|---|---|
committer | thingsym <thingsym@gmail.com> | 2019-04-27 11:55:22 +0300 |
commit | 01d2fbdc5bf151cc33c56aab0507cb0d491053e4 (patch) | |
tree | 4e73d58530f471de25aa69f635e7f0461341a84b | |
parent | 0d854014a0df75d1e5797ef99df7f06f9670289c (diff) |
fix: fix Lastmod's and PublishDate's initial value of 0001-01-01
-rw-r--r-- | exampleSite/content/_index.md | 5 | ||||
-rw-r--r-- | exampleSite/content/getting-started/_index.md | 3 | ||||
-rw-r--r-- | layouts/partials/last-updated.html | 8 |
3 files changed, 12 insertions, 4 deletions
diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 62cb545..15c7f5e 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -1,6 +1,7 @@ --- -date: 2017-10-17T15:26:15Z -lastmod: 2018-12-05T15:26:15Z +date: 2017-10-19T15:26:15Z +lastmod: 2018-12-08T15:26:15Z +publishdate: 2018-11-23T15:26:15Z --- # Hugo Techdoc Theme diff --git a/exampleSite/content/getting-started/_index.md b/exampleSite/content/getting-started/_index.md index aa6c10d..3af5a2b 100644 --- a/exampleSite/content/getting-started/_index.md +++ b/exampleSite/content/getting-started/_index.md @@ -1,7 +1,8 @@ --- title: "Getting Started" date: 2017-10-17T15:26:15Z -lastmod: 2018-12-05T15:26:15Z +lastmod: 2018-12-08T15:26:15Z +publishdate: 2018-11-23T15:26:15Z draft: false weight: 9 --- diff --git a/layouts/partials/last-updated.html b/layouts/partials/last-updated.html index 014c980..4fff863 100644 --- a/layouts/partials/last-updated.html +++ b/layouts/partials/last-updated.html @@ -1 +1,7 @@ -Last updated on {{ $.Lastmod.Format ( $.Site.Params.dateformat | default "2 Jan 2006") }} / Published on {{ $.PublishDate.Format ( $.Site.Params.dateformat | default "2 Jan 2006") -}} +{{ if ne ( .Lastmod.Format "2006-01-02" ) "0001-01-01" }} +Last updated on {{ .Lastmod.Format ( $.Site.Params.dateformat | default "2 Jan 2006") }} +{{ end }} +{{ if ne ( .PublishDate.Format "2006-01-02" ) "0001-01-01" }} +<br> +Published on {{ .PublishDate.Format ( $.Site.Params.dateformat | default "2 Jan 2006") -}} +{{ end }} |