From 6737aba05f442e40331b955246a3428a46ba1be2 Mon Sep 17 00:00:00 2001 From: Stefan Koelle Date: Thu, 10 Sep 2026 21:45:02 +0200 Subject: [PATCH] trailing slash fix 2 --- astro.config.mjs | 2 +- public/_redirects | 34 +++++++++++++++++----------------- src/components/ModemIntro.tsx | 6 +++--- src/components/NavBar.astro | 2 +- src/lib/keymap.ts | 2 +- src/pages/404.astro | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 54c9d48..8a1bd32 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,7 +2,7 @@ import { defineConfig } from 'astro/config'; import react from '@astrojs/react'; export default defineConfig({ site: 'https://28k8.moonweb.org', - trailingSlash: 'never', + trailingSlash: 'always', integrations: [react()], server: { host: '0.0.0.0' }, vite: { server: { allowedHosts: true } } diff --git a/public/_redirects b/public/_redirects index b98c5ca..4bdf092 100644 --- a/public/_redirects +++ b/public/_redirects @@ -1,17 +1,17 @@ -# Redirect trailing slashes to non-trailing slash URLs -/bbs/ /bbs 301 -/bbs/pc/ /bbs/pc 301 -/bbs/pc/phobia/ /bbs/pc/phobia 301 -/bbs/pc/trancemission/ /bbs/pc/trancemission 301 -/bbs/pc/skyline/ /bbs/pc/skyline 301 -/bbs/pc/kosmos-design/ /bbs/pc/kosmos-design 301 -/bbs/atari/ /bbs/atari 301 -/bbs/atari/tropic-dreams/ /bbs/atari/tropic-dreams 301 -/bbs/amiga/ /bbs/amiga 301 -/bbs/amiga/esprit/ /bbs/amiga/esprit 301 -/bbs/amiga/mods/ /bbs/amiga/mods 301 -/bbs/fido/ /bbs/fido 301 -/bbs/fido/ansi-art/ /bbs/fido/ansi-art 301 -/bbs/fido/nodelist/ /bbs/fido/nodelist 301 -/bbs/fido/cds/ /bbs/fido/cds 301 -/bbs/legal-notice/ /bbs/legal-notice 301 +# Redirect non-trailing slash URLs to trailing slash URLs +/bbs /bbs/ 301 +/bbs/pc /bbs/pc/ 301 +/bbs/pc/phobia /bbs/pc/phobia/ 301 +/bbs/pc/trancemission /bbs/pc/trancemission/ 301 +/bbs/pc/skyline /bbs/pc/skyline/ 301 +/bbs/pc/kosmos-design /bbs/pc/kosmos-design/ 301 +/bbs/atari /bbs/atari/ 301 +/bbs/atari/tropic-dreams /bbs/atari/tropic-dreams/ 301 +/bbs/amiga /bbs/amiga/ 301 +/bbs/amiga/esprit /bbs/amiga/esprit/ 301 +/bbs/amiga/mods /bbs/amiga/mods/ 301 +/bbs/fido /bbs/fido/ 301 +/bbs/fido/ansi-art /bbs/fido/ansi-art/ 301 +/bbs/fido/nodelist /bbs/fido/nodelist/ 301 +/bbs/fido/cds /bbs/fido/cds/ 301 +/bbs/legal-notice /bbs/legal-notice/ 301 diff --git a/src/components/ModemIntro.tsx b/src/components/ModemIntro.tsx index 057d66f..4237d8b 100644 --- a/src/components/ModemIntro.tsx +++ b/src/components/ModemIntro.tsx @@ -4,9 +4,9 @@ type DialState = 'idle' | 'dialing'; export default function ModemIntro() { const [state, setState] = useState('idle'); function selectLine(line: 1 | 2) { - if (line === 2) { markConnected(); window.location.href = '/bbs'; return; } + if (line === 2) { markConnected(); window.location.href = '/bbs/'; return; } setState('dialing'); - playLine1Sequence(() => { markConnected(); window.location.href = '/bbs'; }); + playLine1Sequence(() => { markConnected(); window.location.href = '/bbs/'; }); } useEffect(() => { if (state !== 'idle') return; @@ -23,7 +23,7 @@ function selectLine(line: 1 | 2) { | 28k8 [MODEM] ATDT +49-821-2191-038 | +------------------------------------------+`} {state === 'idle' && ( -
 { e.preventDefault(); selectLine(1); }}>{`> Line 1: +49-821-2191-038 [VFC V34] 28800 <`}{'\n\n'} { e.preventDefault(); selectLine(2); }}>{`> Line 2: +49-821-2191-036 [X75]     64000 <`}{'\n\n'}{`>>>>>>>>> SELECT A LINE TO CONNECT <<<<<<<<<`}
+
 { e.preventDefault(); selectLine(1); }}>{`> Line 1: +49-821-2191-038 [VFC V34] 28800 <`}{'\n\n'} { e.preventDefault(); selectLine(2); }}>{`> Line 2: +49-821-2191-036 [X75]     64000 <`}{'\n\n'}{`>>>>>>>>> SELECT A LINE TO CONNECT <<<<<<<<<`}
)} {state === 'dialing' &&

Dialing... please wait.

} diff --git a/src/components/NavBar.astro b/src/components/NavBar.astro index b3491cf..916bf0b 100644 --- a/src/components/NavBar.astro +++ b/src/components/NavBar.astro @@ -3,5 +3,5 @@ export interface Props { showBack?: boolean; } const { showBack = true } = Astro.props; --- diff --git a/src/lib/keymap.ts b/src/lib/keymap.ts index 9a9ede2..a00d64a 100644 --- a/src/lib/keymap.ts +++ b/src/lib/keymap.ts @@ -1,6 +1,6 @@ export type KeymapEntry = { key: string; href: string; label: string }; export const GLOBAL_NAV_KEYS: KeymapEntry[] = [ - { key: 'B', href: '/bbs', label: 'Back to Main Menu' }, + { key: 'B', href: '/bbs/', label: 'Back to Main Menu' }, { key: 'Q', href: 'disconnect', label: 'Disconnect' }, { key: 'I', href: '/bbs/legal-notice', label: 'Legal Notice' }, ]; diff --git a/src/pages/404.astro b/src/pages/404.astro index 384f61d..f3b8d18 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -22,7 +22,7 @@ const box = `\u2554${hr}\u2557
     

- [B] Back to Main Menu + [B] Back to Main Menu

Press B to return to the main menu.