docs(site): add custom 404 page with navigation links
Generate documentation / build-docs (push) Has been cancelled
Generate documentation / build-docs (push) Has been cancelled
Created a custom Starlight 404 page (docs/manual/404.md) that includes LinkCards pointing to common sections (Installation, Troubleshooting, Function Reference). Also updated build-manual.py to prevent '404' from appearing in the generated sidebar.
This commit is contained in:
@@ -673,7 +673,7 @@ def build_site(root: Path, out: Path) -> list[dict]:
|
|||||||
target.parent.mkdir(parents=True, exist_ok=True)
|
target.parent.mkdir(parents=True, exist_ok=True)
|
||||||
body = _inject_subheading_cards(body)
|
body = _inject_subheading_cards(body)
|
||||||
_write_prettified(target, _page_fm(fm), prettify(body))
|
_write_prettified(target, _page_fm(fm), prettify(body))
|
||||||
if rel.name != "index.md":
|
if rel.name not in ("index.md", "404.md"):
|
||||||
sidebar.append({"label": fm["title"], "link": "/" + rel.stem + "/"})
|
sidebar.append({"label": fm["title"], "link": "/" + rel.stem + "/"})
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
title: '404'
|
||||||
|
template: splash
|
||||||
|
editUrl: false
|
||||||
|
man: false
|
||||||
|
hero:
|
||||||
|
title: '404'
|
||||||
|
tagline: Page not found. Check the URL or try using the search bar.
|
||||||
|
---
|
||||||
|
|
||||||
|
<CardGrid>
|
||||||
|
<LinkCard title="Installation" description="Set up the configuration" href="/09-installation/" />
|
||||||
|
<LinkCard title="Troubleshooting" description="Fix common issues" href="/11-troubleshooting/" />
|
||||||
|
<LinkCard title="Function Reference" description="Browse all functions" href="/05-functions/" />
|
||||||
|
</CardGrid>
|
||||||
Reference in New Issue
Block a user