diff --git a/astro.config.mjs b/astro.config.mjs index 7b95613..54c9d48 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,6 +2,7 @@ import { defineConfig } from 'astro/config'; import react from '@astrojs/react'; export default defineConfig({ site: 'https://28k8.moonweb.org', + trailingSlash: 'never', integrations: [react()], server: { host: '0.0.0.0' }, vite: { server: { allowedHosts: true } } diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 0000000..b98c5ca --- /dev/null +++ b/public/_redirects @@ -0,0 +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 diff --git a/src/components/ModemIntro.tsx b/src/components/ModemIntro.tsx index e86b9ad..057d66f 100644 --- a/src/components/ModemIntro.tsx +++ b/src/components/ModemIntro.tsx @@ -3,11 +3,11 @@ import { playLine1Sequence, markConnected } from '../lib/sound'; 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; } - setState('dialing'); - playLine1Sequence(() => { markConnected(); window.location.href = '/bbs/'; }); - } +function selectLine(line: 1 | 2) { + if (line === 2) { markConnected(); window.location.href = '/bbs'; return; } + setState('dialing'); + playLine1Sequence(() => { markConnected(); window.location.href = '/bbs'; }); +} useEffect(() => { if (state !== 'idle') return; function onKeyDown(e: KeyboardEvent) { @@ -23,7 +23,7 @@ export default function ModemIntro() { | 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 916bf0b..b3491cf 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 a00d64a..9a9ede2 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 f3b8d18..384f61d 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.