Skip to content

Conversation

@dscho
Copy link
Member

@dschodscho 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.

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

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

@dschodschoforce-pushed the upgrade-hugo-and-pagefind branch from eb9981f to bfe364cCompareJuly 15, 2025 08:00
dscho added 2 commits July 30, 2025 19:56
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 <[email protected]>
@dschodschoforce-pushed the upgrade-hugo-and-pagefind branch from bfe364c to e9be74aCompareJuly 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 <[email protected]>
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 <[email protected]>
@dschodschoforce-pushed the upgrade-hugo-and-pagefind branch from f5dedca to e906153CompareJuly 31, 2025 02:01
@dschodscho marked this pull request as ready for review July 31, 2025 02:08
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
MemberAuthor

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

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

@To1ne
Copy link
Collaborator

@dscho So this is ready to merge?

@dscho
Copy link
MemberAuthor

@dscho So this is ready to merge?

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

@To1neTo1ne merged commit 7bd9873 into git:gh-pagesJul 31, 2025
1 check passed
@dschodscho deleted the upgrade-hugo-and-pagefind branch August 1, 2025 07:25
Sign up for freeto 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

@dscho@To1ne@GypsyS44