From 2d6f7c84c6610b49e84f7e0375ed5657927891cc Mon Sep 17 00:00:00 2001 From: LSweetSour <61788097+yappy2000d@users.noreply.github.com> Date: Sat, 28 Sep 2024 13:53:59 +0800 Subject: [PATCH] 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. --- layouts/partials/head/opengraph/provider/base.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/head/opengraph/provider/base.html b/layouts/partials/head/opengraph/provider/base.html index 055745d..816e5ff 100644 --- a/layouts/partials/head/opengraph/provider/base.html +++ b/layouts/partials/head/opengraph/provider/base.html @@ -32,12 +32,12 @@ {{- end -}} {{- else -}} - {{- if not .Site.Lastmod.IsZero -}} - + {{- if not .Site.LastChange.IsZero -}} + {{- end -}} {{- end -}} {{ $image := partialCached "helper/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }} {{- if $image.exists -}} -{{- end -}} \ No newline at end of file +{{- end -}}