Skip to content
✨ Publier v1 is live — a polished docs platform built for the open web.
On this page

404 page

The shell's default not-found route and a custom src/pages/404.astro implementation.

The shell supplies a default 404 route. Add src/pages/404.astro to customize it for your site’s design.

Route control

pages.404 is not applied. The existing docsShell({ routes: { notFound: false } }) option disables the shell’s default 404 route; it does not remove your own src/pages/404.astro. Your host determines how the built 404 page handles unmatched requests. See Pages for the current limits.

Adding a custom 404

Create src/pages/404.astro:

src/pages/404.astro
---
import BaseLayout from '@publier/shell/layouts/base-layout.astro';
---
<BaseLayout title="404 — Page not found">
<main class="max-w-xl mx-auto my-32 px-6 text-center">
<h1 class="text-6xl font-bold">404</h1>
<p class="mt-4">The page you were looking for doesn't exist.</p>
<a href="/" class="btn btn-primary mt-6">Go home</a>
</main>
</BaseLayout>

BaseLayout injects the site nav, footer, theme CSS, and head boilerplate.