Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct Lastmod field access in OpenGraph meta tags #1063

Closed
wants to merge 1 commit into from

Conversation

yappy2000d
Copy link

  • 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.

cloudflare pages building.log

- 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.
@CaiJimmy
Copy link
Owner

CaiJimmy commented Oct 6, 2024

Deprecated in v0.123.0.
Use .Site.Lastmod instead.

https://gohugo.io/methods/site/lastchange/

You are seeing that error because you are using an outdated version of Hugo. See #974

@CaiJimmy CaiJimmy closed this Oct 6, 2024
@yappy2000d yappy2000d deleted the yappy2000d-patch-1 branch October 6, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants