What happened?
Raw (unformatted) .Date is used here:
|
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default ":date_long" site.Params.DateFormat)))) }} |
... which leads to duplicate timezone information. Reasons are described here:
gohugoio/hugo#5907,
gohugoio/hugo#9096
This issue could be fixed by using explicit formatting like this:
diff --git a/layouts/_partials/post_meta.html b/layouts/_partials/post_meta.html
index c7c2635..decaef3 100644
--- a/layouts/_partials/post_meta.html
+++ b/layouts/_partials/post_meta.html
@@ -1,7 +1,7 @@
{{- $scratch := newScratch }}
{{- if not .Date.IsZero -}}
- {{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default ":date_long" site.Params.DateFormat)))) }}
+ {{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date | time.Format "2006-01-02T15:04:05-07:00") (.Date | time.Format (default ":date_long" site.Params.DateFormat)))) }}
{{- end }}
{{- if (.Param "ShowReadingTime") -}}
Another file worth checking:
|
"datePublished": {{ .PublishDate }}, |
|
"dateModified": {{ .Lastmod }}, |
Steps to reproduce
- Create post with date in timezone that doesn't match system timezone
- Publish it
- Check the date format in the post meta
Hugo Version
Hugo >= 0.146.0 (Recommended - Minimum version required for PaperMod)
PaperMod Version
154d006
What kind of devices are you seeing the problem on?
Desktop
What browsers are you seeing the problem on?
No response
Browser Version
No response
Relevant log output
<span title='2023-06-08 01:32:03 +0200 +0200'>
Repository/Source Code link where this issue can be reproduced
No response
Code of Conduct
What happened?
Raw (unformatted)
.Dateis used here:hugo-PaperMod/layouts/_partials/post_meta.html
Line 4 in 154d006
... which leads to duplicate timezone information. Reasons are described here: gohugoio/hugo#5907, gohugoio/hugo#9096
This issue could be fixed by using explicit formatting like this:
Another file worth checking:
hugo-PaperMod/layouts/_partials/templates/schema_json.html
Lines 93 to 94 in 154d006
Steps to reproduce
Hugo Version
Hugo >= 0.146.0 (Recommended - Minimum version required for PaperMod)
PaperMod Version
154d006
What kind of devices are you seeing the problem on?
Desktop
What browsers are you seeing the problem on?
No response
Browser Version
No response
Relevant log output
Repository/Source Code link where this issue can be reproduced
No response
Code of Conduct