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

Upgrade Hugo to 0.107.0 #2403

Merged
merged 33 commits into from
Dec 8, 2022
Merged

Upgrade Hugo to 0.107.0 #2403

merged 33 commits into from
Dec 8, 2022

Conversation

bryanfriedman
Copy link
Contributor

@bryanfriedman bryanfriedman commented Nov 4, 2022

This PR upgrades hugo, Node and some related GitHub actions. Here is a list of specific changes:

  • Upgrades hugo from a very old version (0.82.0) to the most recent version (0.107.0)
    • This required changing the logic of the render hooks as well as many of the relative links across the site as a result of this change which relates to this "bug": Bug in relURL with leading slash when baseURL includes a subdirectory gohugoio/hugo#9994). We had been relying on this to handle the prepending of /developer to all relative links, so we had to update our codebase to reflect the new behavior. This represents the bulk of the changes.
    • Updated Makefile to check for hugo version before running a build.
    • Fixed deprecated hugo code (tweet shortcode must include username and .Path should use .File.Path).
  • Updates to GitHub Actions.
  • Adds .nvmrc file to pin Netlify to using Node 16 during build.
    • The reason this is required even though the default should already be v16 for default image that Netlify is set to use - Ubuntu Focal 20.04 - when the site repository was originally linked to Netlify, it was using an older image that defaulted to v12, so it must be specified explicitly in the .nvmrc file. (See this article for more details.)
  • Removed Node devDependencies that were not being used.

@bryanfriedman bryanfriedman changed the title Try hugo upgrade Try hugo upgrade WIP Nov 4, 2022
@bryanfriedman bryanfriedman changed the title Try hugo upgrade WIP [WIP] Try hugo upgrade Nov 14, 2022
@bryanfriedman
Copy link
Contributor Author

@danielramirez0 I think I've got this pretty well working. Main thing left is I will be updating the README to reflect the new version changes and other details. We can look at this together next week and we should socialize to TDC Slack channels for folks who build locally as they will need to do some brew upgrades, etc.

Makefile Outdated
@echo hugo $(hugo_local) validated
else
@echo $@ failure: Your hugo version \($(hugo_local)\) does not match production \($(hugo_prod)\)
@echo run \'make hugo-update\' or \'brew upgrade hugo\'
Copy link
Contributor

@danielramirez0 danielramirez0 Dec 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanfriedman Haven't written the rule for hugo-update yet, but also may not need if we just direct them to upgrade via brew manually. Also had an idea to write a rule for automating the prerequisite stuff for new (and maybe even existing) contributors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I think we should avoid trying to auto install or update hugo for now. It could get pretty hairy as we'd have to check if they're on a Mac, what version they have to see if we have to install or upgrade, etc. The logic is doable but complex so I think we just change the message to say use brew upgrade or brew install or wget etc. for now.

@bryanfriedman bryanfriedman changed the title [WIP] Try hugo upgrade Upgrade Hugo to 0.107.0 Dec 6, 2022
@danielramirez0 danielramirez0 merged commit 2be5646 into main Dec 8, 2022
@danielramirez0 danielramirez0 deleted the upgrade-hugo branch December 8, 2022 18:05
@bryanfriedman bryanfriedman linked an issue Dec 9, 2022 that may be closed by this pull request
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.

Upgrade to latest version of Hugo
2 participants