alpha
Login
or
Join now
jeremy.herve.bzh
/
skypress
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
A calm place to write long-form, and publish it to the open social web.
skypress.blog/
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Add global 404 page for SP12
author
Jeremy Herve
date
2 weeks ago
(Jun 9, 2026, 6:33 PM +0200)
commit
b6a07781
b6a077819bfef6974d0b11a846267450e3ec0ab4
parent
dcd2056e
dcd2056ee5ab93b6860716f2b39d9de351997665
+31
2 changed files
Expand all
Collapse all
Unified
Split
src
pages
404.astro
404.meta.test.ts
+12
src/pages/404.astro
Reviewed
···
1
1
+
---
2
2
+
import ErrorScene from '../components/ErrorScene.astro';
3
3
+
import { errorScene } from '../lib/reader/errors';
4
4
+
5
5
+
// Generic, data-free: prerender to a static 404.html the adapter serves for
6
6
+
// any unmatched URL.
7
7
+
export const prerender = true;
8
8
+
9
9
+
const scene = errorScene( 'not-found' );
10
10
+
---
11
11
+
12
12
+
<ErrorScene eyebrow={scene.eyebrow} heading={scene.heading} subline={scene.subline} />
+19
src/pages/404.meta.test.ts
Reviewed
···
1
1
+
import { readFileSync } from 'node:fs';
2
2
+
import { dirname, join } from 'node:path';
3
3
+
import { fileURLToPath } from 'node:url';
4
4
+
import { describe, expect, it } from 'vitest';
5
5
+
6
6
+
const here = dirname( fileURLToPath( import.meta.url ) );
7
7
+
const page = readFileSync( join( here, './404.astro' ), 'utf8' );
8
8
+
9
9
+
describe( 'global 404 page', () => {
10
10
+
it( 'is prerendered (static, no per-request data)', () => {
11
11
+
expect( page ).toMatch( /export const prerender = true/ );
12
12
+
} );
13
13
+
14
14
+
it( 'renders ErrorScene with the generic not-found copy', () => {
15
15
+
expect( page ).toMatch( /import ErrorScene from '[^']*components\/ErrorScene.astro'/ );
16
16
+
expect( page ).toMatch( /errorScene\(\s*'not-found'\s*\)/ );
17
17
+
expect( page ).toMatch( /<ErrorScene/ );
18
18
+
} );
19
19
+
} );