Skip to content

Comments

Add default 404 page to sbt-typelevel-site#871

Open
abby-ql wants to merge 8 commits intotypelevel:mainfrom
abby-ql:html-injection
Open

Add default 404 page to sbt-typelevel-site#871
abby-ql wants to merge 8 commits intotypelevel:mainfrom
abby-ql:html-injection

Conversation

@abby-ql
Copy link

@abby-ql abby-ql commented Feb 24, 2026

This PR closes issue #217
-adds a default 404.html page to sbt-typelevel-site injected at the theme level so that all sites using the plugin automatically receive a 404 page by default
-page added programmatically via ThemeBuilder.addInputs, similar to how the API forwarder page is injected
-allow users to override it by providing their own docs/404.md or docs/404.html
-the default 404 page keeps the Helium style & allow click to go back to homepage(index.html)

Manual testing done to:
-verify 404.html is generated when no user defined 404 exists
-confirm a user-provided docs/404.md overrides the default
-checked correct behavior in tlSitePreview and in generated static output

Before:
image
Now:
image
(I initially explored an alternative approach where a default 404.md was written into mdocOut so that Laika would render it through Helium and apply full layout styling. This worked visually, but the 404 page appeared in the sidebar and it requires additional task wiring so I gave up on that approach)

@mergify mergify bot added the site label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant