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

Set fetch depth to 0 to pull history to fix hugo lastmod #32

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

nginx-jack
Copy link
Collaborator

@nginx-jack nginx-jack commented Oct 2, 2024

Proposed changes

We use Hugo Lastmod to generate last-modified metadata in our rendered pages, as well as lastmod values across site maps.
By default, the github checkout action only fetches at a depth of 1, which is faster and fine for most cases. Hugo uses this to figure out the last modified date, so all metadata was being set to the current date, and therefore incorrect.
For our largest repo, this add 4 seconds to our checkout time, which we can afford 😅 .

Add enableGitInfo=true to hugo's config.toml.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md and CHANGELOG.md)

@nginx-jack nginx-jack added the bug Something isn't working label Oct 2, 2024
@nginx-jack nginx-jack requested a review from a team October 2, 2024 10:28
@nginx-jack nginx-jack self-assigned this Oct 2, 2024
@nginx-jack nginx-jack requested a review from a team as a code owner October 2, 2024 10:28
@nginx-jack nginx-jack merged commit 69843fb into main Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants