Skip to content

Add 404 page #6

@AJaccP

Description

@AJaccP

🧠 Context

There's no custom 404 page, so a bad URL falls back to the host's default (e.g. a bare GitHub Pages 404). Astro turns src/pages/404.astro into a static 404.html automatically, and GitHub Pages serves it for unknown paths. This ticket adds a small, on-brand 404 that uses the existing Base layout (so it keeps the header, footer, and site styling) and points people back to the gallery.

Files you'll touch:

  • src/pages/404.astro (new)

Don't edit: the layout, header, footer, or any other page. This is one self-contained route.


🛠️ Implementation Plan

  1. Create src/pages/404.astro using the Base layout so it inherits the shell:

    ---
    import Base from '../layouts/Base.astro';
    ---
    
    <Base title="Page not found · CCSS Showcase">
      <section>
        <p>404</p>
        <h1>Page not found</h1>
        <p>That page doesn't exist (or moved). Try the project gallery.</p>
        <a href="/projects">Back to projects</a>
      </section>
    </Base>
  2. Style it within the token system (text-accent, text-muted, bg-ink, etc.) — keep it simple and centered. Don't pull in new assets or dependencies. Pay attention to text hierarchy and colors, try to keep it consistent with the rest of the site.

  3. Verify. Run pnpm dev, hit a nonexistent path (e.g. /test), and confirm you see the custom 404 page with the header and footer present.


✅ Acceptance Criteria

  • src/pages/404.astro renders inside the Base layout (header + footer present).
  • It has a clear "not found" message and a link back to /projects.
  • Styling uses the existing tokens; no new dependencies or assets.
  • pnpm build produces dist/404.html.
  • pnpm format:check, pnpm check, and pnpm build all pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions