mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-28 19:43:31 +08:00
fix: Correct Lastmod field access in OpenGraph meta tags
- Updated the OpenGraph meta tags to correctly access the Lastmod field. - For pages, use .Lastmod instead of .Site.Lastmod. - For non-pages, use .Site.LastChange instead of .Site.Lastmod. - Ensured proper formatting for published and modified times in OpenGraph meta tags. The original content caused issues on Cloudflare Pages due to incorrect access of the Lastmod field, leading to build failures.
This commit is contained in:
parent
048a000f17
commit
2d6f7c84c6
@ -32,8 +32,8 @@
|
||||
<meta property='article:modified_time' content='{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if not .Site.Lastmod.IsZero -}}
|
||||
<meta property='og:updated_time' content='{{ .Site.Lastmod.Format " 2006-01-02T15:04:05-07:00 " | safeHTML }}'/>
|
||||
{{- if not .Site.LastChange.IsZero -}}
|
||||
<meta property='og:updated_time' content='{{ .Site.LastChange.Format "2006-01-02T15:04:05-07:00" | safeHTML }}'/>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user