Add default 404 page to sbt-typelevel-site#871
Add default 404 page to sbt-typelevel-site#871abby-ql wants to merge 8 commits intotypelevel:mainfrom
Conversation
|
@abby-ql thanks for the PR! before I review, would you mind making a contribution to our onboarding repo? There are instructions in the README. Thank you! |
|
sure @armanbilge i have just made a PR to the onboarding repo, thank you! |
@abby-ql thanks for mentioning this! I actually think this approach sounds interesting, and maybe we can debug some of the problems you encountered. Would you mind opening an alternative PR that tries this, so I can help you work through it? For example, instead of writing to |
|
@armanbilge Thank you so much for the feedback! Yep, the task approach was exactly what I did in my earlier experiment. I defined a custom Following your suggestion I’ll open an alternative PR that try adding the default 404.md directly to laika’s virtual input tree at the build level:) |
This PR closes issue #217
-adds a default
404.htmlpage tosbt-typelevel-siteinjected 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.mdordocs/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.htmlis generated when no user defined 404 exists-confirm a user-provided
docs/404.mdoverrides the default-checked correct behavior in
tlSitePreviewand in generated static outputBefore:


Now:
(I initially explored an alternative approach where a default
404.mdwas written intomdocOutso 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)