From fb33951b8f6a0f7ea3ef5d84235469785761158f Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 29 Nov 2023 05:52:05 -0800 Subject: [PATCH] Use UTC for all timestamps --- layouts/_default/list.atom.xml | 6 +++--- layouts/_default/rss.xml | 4 ++-- layouts/_default/sitemap.xml | 2 +- layouts/about/list.html | 4 ++-- layouts/index.gmi | 2 +- layouts/meta/list.html | 4 ++-- layouts/partials/head.html | 4 ++-- layouts/partials/post-meta/post-meta.html | 4 ++-- layouts/partials/posts.html | 4 ++-- layouts/posts/single.gmi | 4 ++-- layouts/shortcodes/build-info.html | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/layouts/_default/list.atom.xml b/layouts/_default/list.atom.xml index 5e986de..336addd 100644 --- a/layouts/_default/list.atom.xml +++ b/layouts/_default/list.atom.xml @@ -53,7 +53,7 @@ - {{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ site.LastChange.UTC.Format "2006-01-02T15:04:05-07:00" | safeHTML }} Hugo {{ .Site.Hugo.Version }} {{ .Permalink }} {{ range $pages -}} @@ -62,8 +62,8 @@ {{ .Title }} {{ .Permalink }} - {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} - {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ .Date.UTC.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ .Lastmod.UTC.Format "2006-01-02T15:04:05-07:00" | safeHTML }} {{ .Site.Author.name }}https://seirdy.one/ CC-BY-SA 4.0 diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index a746b73..80be502 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -33,7 +33,7 @@ {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{ .Date.UTC.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} @@ -42,7 +42,7 @@ {{- .Page.Scratch.Set "codeIndex" 1 -}} {{ .Title }} {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ .Date.UTC.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} {{- .Content | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | replaceRE `` "" | html -}} diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 6d59e48..4a8519e 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -4,7 +4,7 @@ {{- if not .Params.private -}} {{ .Permalink }} - {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ with .Sitemap.ChangeFreq }} + {{ safeHTML ( .Lastmod.UTC.Format "2006-01-02T15:04:05-07:00" ) }}{{ with .Sitemap.ChangeFreq }} {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} {{ .Sitemap.Priority }}{{ end }} diff --git a/layouts/about/list.html b/layouts/about/list.html index c1e437e..c0a7654 100644 --- a/layouts/about/list.html +++ b/layouts/about/list.html @@ -21,9 +21,9 @@

- Posted + Posted {{- if gt (sub .Lastmod.Unix .Date.Unix) 3600 -}} - , updated {{ .Lastmod.Format "2006-01-02 15:04" }} + , updated {{ .Lastmod.UTC.Format "2006-01-02 15:04" }} {{- end }}

diff --git a/layouts/index.gmi b/layouts/index.gmi index 035441d..f0a0f98 100644 --- a/layouts/index.gmi +++ b/layouts/index.gmi @@ -3,7 +3,7 @@ ## Gemlog posts {{ range (where .Site.RegularPages "Section" "posts") }} {{- if .OutputFormats.Get "gemtext" }} -=> {{replace .Permalink "/gemini" "" 1}} {{ .Date.Format "2006-01-02" }}: {{.Title | safeHTML}}{{ end }}{{ end }} +=> {{replace .Permalink "/gemini" "" 1}} {{ .Date.UTC.Format "2006-01-02" }}: {{.Title | safeHTML}}{{ end }}{{ end }} => posts/index.xml RSS feed diff --git a/layouts/meta/list.html b/layouts/meta/list.html index aa6b170..3cf121d 100644 --- a/layouts/meta/list.html +++ b/layouts/meta/list.html @@ -21,9 +21,9 @@

- Posted + Posted {{- if gt (sub .Lastmod.Unix .Date.Unix) 3600 -}} - , updated {{ .Lastmod.Format "2006-01-02 15:04" }} + , updated {{ .Lastmod.UTC.Format "2006-01-02 15:04" }} {{- end }}

diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c07ed7a..f714f7d 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -48,10 +48,10 @@ {{ if and (gt .Date 0) (not .Params.evergreen) -}} - + {{ end -}} {{ if lt .Date .Lastmod -}} - + {{- end -}} {{ if not (in site.BaseURL ".onion") -}} diff --git a/layouts/partials/post-meta/post-meta.html b/layouts/partials/post-meta/post-meta.html index 419e403..c8eae2d 100644 --- a/layouts/partials/post-meta/post-meta.html +++ b/layouts/partials/post-meta/post-meta.html @@ -25,11 +25,11 @@

{{- end }} {{ if $needsList }}

  • {{ end }} -{{- $action }} {{ .Date.Format "2006-01-02" }} by {{ partial "indieweb-author.html" -}}{{ if not $shortMeta }} on his {{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and Gemini capsule{{ end }}{{- end -}}. +{{- $action }} {{ .Date.UTC.Format "2006-01-02" }} by {{ partial "indieweb-author.html" -}}{{ if not $shortMeta }} on his {{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and Gemini capsule{{ end }}{{- end -}}. {{ if $needsList }}
  • {{ end }} {{- if gt (sub .Lastmod.Unix .Date.Unix) 900 -}} {{ if $needsList }}
  • {{ end }} - Last updated .{{ if not $shortMeta }} Changelog{{ end }} + Last updated .{{ if not $shortMeta }} Changelog{{ end }} {{ if $needsList }}
  • {{ end }} {{- end -}} {{- if not $isNotes -}} diff --git a/layouts/partials/posts.html b/layouts/partials/posts.html index b8d713b..b6a54f5 100644 --- a/layouts/partials/posts.html +++ b/layouts/partials/posts.html @@ -19,9 +19,9 @@

    - Posted + Posted {{- if lt .Date .Lastmod -}} - , updated {{ .Lastmod.Format "2006-01-02" }} + , updated {{ .Lastmod.UTC.Format "2006-01-02" }} {{- end }}

    diff --git a/layouts/posts/single.gmi b/layouts/posts/single.gmi index 7ce51f8..c3b3db8 100644 --- a/layouts/posts/single.gmi +++ b/layouts/posts/single.gmi @@ -2,9 +2,9 @@ {{ $lastmod := .Lastmod -}} {{ if lt .Date $lastmod -}} -Originally posted {{ .Date.Format "2006-01-02" }}. Last updated {{ .Lastmod.Format "2006-01-02" }}. +Originally posted {{ .Date.UTC.Format "2006-01-02" }}. Last updated {{ .Lastmod.UTC.Format "2006-01-02" }}. {{ else -}} -Posted {{ .Date.Format "2006-01-02" }}. +Posted {{ .Date.UTC.Format "2006-01-02" }}. {{ end }} {{ trim (readFile (replace $.File.Path ".md" ".gmi")) "\n" | safeHTML }} diff --git a/layouts/shortcodes/build-info.html b/layouts/shortcodes/build-info.html index ab8a94e..4049e5b 100644 --- a/layouts/shortcodes/build-info.html +++ b/layouts/shortcodes/build-info.html @@ -5,7 +5,7 @@ {{- end -}}

    This site was last built on - + by Hugo {{ .Site.Hugo.Version }} {{ $buildCtx }}.