Skip to content

Update Hugo and Pagefind to their respective latest versions #2026

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

Merged
merged 4 commits into from
Jul 31, 2025

Conversation

dscho
Copy link
Member

@dscho dscho commented Jul 6, 2025

Changes

  • Updates Hugo and Pagefind.

Context

It is always good to stay reasonably up to date. In particular with the recent updates of Hugo's template logic, it opens the door for uncluttering layouts/_default/baseof.html a little, and now that that flurry of Hugo updates (to make said new template logic work) seems to have calmed down, it's a good idea to go for that update and see where it leads us.

This fixes #1995.

@dscho dscho self-assigned this Jul 6, 2025
@dscho dscho marked this pull request as ready for review July 6, 2025 12:27
@dscho dscho force-pushed the upgrade-hugo-and-pagefind branch 2 times, most recently from 7fa6cec to eb9981f Compare July 9, 2025 14:02
@dscho dscho marked this pull request as draft July 9, 2025 14:09
@dscho
Copy link
Member Author

dscho commented Jul 10, 2025

Looks like upgrading to Hugo v0.148.0 causes build failures due to these breaking changes in Hugo.

@dscho dscho force-pushed the upgrade-hugo-and-pagefind branch from eb9981f to bfe364c Compare July 15, 2025 08:00
dscho added 2 commits July 30, 2025 19:56
This fixes git#1995.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This script currently only works on Linux. If need be, it can be
extended to cover other operating systems. That will be the
responsibility of people who want that support, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the upgrade-hugo-and-pagefind branch from bfe364c to e9be74a Compare July 30, 2025 18:16
dscho added 2 commits July 31, 2025 03:54
As of v0.148.0, Hugo no longer generates `<base>.html` files for
`<base>/_index.html` files; For full details, see
https://discourse.gohugo.io/t/breaking-changes-in-v0-148-0/55257.

That means that e.g. `book.html` is now missing, and only
`book/index.html` is present (but we want both so that either
https://git-scm.com/book or https://git-scm.com/book/ are fine).

Therefore, we need to add explicit aliases to get those `<base>.html`
files back after upgrading to Hugo v0.148.0.

Note that this commit includes changes to the (generated) `book/` files.
This is intentional; The next commit will adjust the script that
generates those files.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The preceding commit adapted the `_index.html` files so that even after
Hugo v0.148.0 aliases such as `/book.html` are generated. That commit
included the necessary changes also for the (generated) `external/book/`
files. Let's also adjust the script so that these explicit aliases will
keep getting re-generated.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the upgrade-hugo-and-pagefind branch from f5dedca to e906153 Compare July 31, 2025 02:01
@dscho dscho marked this pull request as ready for review July 31, 2025 02:08
@@ -4,6 +4,8 @@
url: /downloads.html
aliases:
- /downloads/index.html
- /download/index.html
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we adding these singular aliases?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's actually half a bug fix. We used to support only the URLs without the trailing slash for those aliases. And thanks to the change in Hugo, now we would only support the ones with the slashes. Now we support both.

@To1ne
Copy link
Collaborator

To1ne commented Jul 31, 2025

@dscho Overall it looks good. Just a few questions though.

@To1ne
Copy link
Collaborator

To1ne commented Jul 31, 2025

@dscho So this is ready to merge?

@dscho
Copy link
Member Author

dscho commented Jul 31, 2025

@dscho So this is ready to merge?

@To1ne from my side, yes, if you don't have any further concerns... 😊

@To1ne To1ne merged commit 7bd9873 into git:gh-pages Jul 31, 2025
1 check passed
@dscho dscho deleted the upgrade-hugo-and-pagefind branch August 1, 2025 07:25
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.

Adapt to Hugo 0.146+
3 participants