Support trailing-slash URLs - #231
Merged
tillkamppeter merged 1 commit intoAug 13, 2026
Merged
Conversation
tillkamppeter
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #207.
Summary
This fixes broken URLs caused by inconsistent trailing-slash handling between the repository and the deployed GitHub Pages site.
The site now:
/pageand/page//pageas the canonical URL<link>URLs without trailing slashes<guid>valuesThe site root itself remains
https://openprinting.github.io/, in the sitemap and RSS channel link.Root cause
deploy.ymlpassedstatic_site_generator: nexttoactions/configure-pages.The action does not recognize this repository's
next.config.tsand generated anext.config.js, which Next.js preferred over the repository configuration.As a result, the deployed build used different trailing-slash behavior from the repository configuration and exported flat routes such as
page.html. GitHub Pages served/pagebut returned 404 for/page/.Because only the deploy workflow injected that generated config, local and PR builds used the repository configuration and produced the opposite layout, which is why this did not reproduce outside production.
Several URL generators also explicitly produced trailing-slash URLs, including the RSS feed, sitemap, canonical URLs, Foomatic legacy redirects, and internal Markdown links.
The RSS issue is what caused external links, including those consumed by LWN, to return 404.
Fix
static_site_generator: nextso the repository'snext.config.tsis used during deployment.trailingSlash: false, keeping/pagecanonical.page/index.htmlaliases so existing/page/URLs continue to work.<link>URLs to the slashless form.verify:urlsto CI and the deployment workflow. It reads./outand rebuilds nothing, so a broken export cannot be deployed.RSS
<guid>values are intentionally preserved in their historical form because they represent feed-item identity. Changing them could cause existing articles to be treated as new items by feed readers.Note that
/page/answers 200 with an instant meta-refresh rather than a 301. GitHub Pages cannot issue real redirects for static files. Each alias isnoindexwithrel="canonical"pointing at/page, so the canonical URL remains the slashless form.Verification
yarn verify:urlspasses./cups/was intentionally preserved because it belongs to the separate CUPS Pages site.The alias approach relies on GitHub Pages serving
page.htmlfor/pagewhilepage/index.htmlhandles/page/. This was verified against a live GitHub Pages site that has both files present, but the precedence behavior is not explicitly documented by GitHub.After deployment I will confirm both forms directly on
openprinting.github.io:Both should return 200. If
/newswere ever answered with a 301 instead, the precedence assumption would be wrong and this should be reverted; the aliases would then need to contain full page copies rather than redirects.