Page not found
++ This address does not serve a page. Documentation routes change as the + corpora converge, so an older link can land here. +
++ Start from the + documentation map or the + Bitty home page. +
+diff --git a/astro.config.mjs b/astro.config.mjs index 35cbe57..61264e5 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -302,11 +302,17 @@ export default defineConfig({ markdown: { // Dual code theme (CTX-0049, website#95): Shiki emits both palettes as // custom properties and global.css picks the one that matches the - // document colour scheme. `one-light`/`one-dark-pro` sit closest to the - // cool neutral + vermilion palette; the previous single `github-dark` - // theme painted a dark block onto the pale page. + // document colour scheme; the previous single `github-dark` theme painted + // a dark block onto the pale page. + // + // Light palette (CTX-0057, website#129): `one-light` painted comments at + // 2.30:1, strings 2.86, keywords 3.28 and builtins 3.73 on the light code + // background -- all below the WCAG AA 4.5 threshold that axe flagged at + // "serious" across 296 nodes. `github-light` keeps a restrained neutral + // palette and clears the threshold on every token role, measured on the + // built artefact rather than assumed. shikiConfig: { - themes: { light: "one-light", dark: "one-dark-pro" }, + themes: { light: "github-light", dark: "one-dark-pro" }, }, processor: satteri({ mdastPlugins: [ diff --git a/src/components/VersionSelector.astro b/src/components/VersionSelector.astro index 57f133c..e73c7aa 100644 --- a/src/components/VersionSelector.astro +++ b/src/components/VersionSelector.astro @@ -37,6 +37,23 @@ type Props = { const { currentRoute, currentVersion, targetIdentities } = Astro.props as Props; +/** Reader-facing version label: the pinned corpus keeps its machine + * timestamp in `versions.json`, but milliseconds are data, not copy + * (website#134). Render the date a reader can scan. */ +const humaniseLabel = (label: string): string => { + const iso = label.match(/\d{4}-\d{2}-\d{2}T[\d:.]+Z/); + if (!iso) return label; + const date = new Date(iso[0]); + if (Number.isNaN(date.getTime())) return label; + const readable = date.toLocaleDateString("en-GB", { + day: "numeric", + month: "short", + year: "numeric", + timeZone: "UTC", + }); + return label.replace(iso[0], readable); +}; + const entries = versions.versions.map((entry) => versionEntryPresentation({ currentRoute, @@ -61,7 +78,7 @@ const entries = versions.versions.map((entry) => href={entry.href} data-current={entry.isCurrent ? "true" : undefined} > - {entry.label} + {humaniseLabel(entry.label)} {entry.suffix} {entry.isCurrent && ( (current version) diff --git a/src/pages/404.astro b/src/pages/404.astro new file mode 100644 index 0000000..3582835 --- /dev/null +++ b/src/pages/404.astro @@ -0,0 +1,69 @@ +--- +/** Not-found page (website#131). + * + * The site moves documentation routes behind redirect families, so any link + * older than the last rename lands here. It renders inside the normal shell - + * the same header, search and footer - because a reader who arrives from a + * stale URL needs a way forward, not a blank body. + * + * Served by `assets.not_found_handling: "404-page"` in `wrangler.jsonc`, which + * is why the markup must stand on its own: it is the only recovery path for a + * URL outside the redirect families. + */ +import "../styles/global.css"; +import SiteFooter from "../components/SiteFooter.astro"; +import SiteHeader from "../components/SiteHeader.astro"; +--- + + + +
+ + + + + + + + ++ This address does not serve a page. Documentation routes change as the + corpora converge, so an older link can land here. +
++ Start from the + documentation map or the + Bitty home page. +
+`; the inline-code
+ * chrome used to paint that inner `` with the pale paper tint, so every
+ * syntax token sat on a tinted surface instead of the theme's own background
+ * and the red/comment roles measured 4.09/4.30 against the 4.5 AA threshold.
+ * Inside a code block the surface belongs to the block, not the inline style. */
+@media (prefers-color-scheme: light) {
+ /* website#129: the light fix below is scoped to the light scheme on purpose:
+ * the dark palette was measured AA-clean against the surface it already
+ * had, and re-painting it there moved the comment role to 3.73. */
+ .prose pre code {
+ padding: 0;
+ border: 0;
+ background: none;
+ font-size: inherit;
+ }
}
.prose pre {
@@ -763,11 +784,24 @@ body > .version-selector {
overflow-x: auto;
border: 1px solid var(--line);
border-radius: var(--radius);
- background: var(--card);
+ /* website#129: the light code surface is the theme's own background.
+ * The pale paper tint cost the red and comment tokens ~0.5 and pushed
+ * github-light just under the AA 4.5 threshold. Dark keeps its own block
+ * via the --shiki-dark-bg override in the palette media block. */
+ background: #fff;
font-size: var(--text-sm);
line-height: var(--leading-code);
}
+/* website#129: the light code surface is the syntax theme's own background.
+ * The pale paper tint cost the red and comment tokens ~0.5 and left
+ * github-light just under the AA 4.5 threshold; dark keeps its own block via
+ * the --shiki-dark-bg override in the palette media block. */
+.prose pre.astro-code,
+.code-block pre.astro-code {
+ background: #fff;
+}
+
/* Shiki dual theme (CTX-0049): Astro inlines the light palette (`color`) and
* carries the dark one in `--shiki-dark*` custom properties, so only the dark
* palette needs an override and the light values stay as rendered. Both
diff --git a/wrangler.jsonc b/wrangler.jsonc
index 9677b5f..bcc6733 100644
--- a/wrangler.jsonc
+++ b/wrangler.jsonc
@@ -4,5 +4,6 @@
"compatibility_date": "2026-08-25",
"assets": {
"directory": "./dist",
+ "not_found_handling": "404-page",
},
}