From e40534424433ce4ca19539144322b7efc28e5157 Mon Sep 17 00:00:00 2001 From: Ciffelia Date: Sun, 13 Aug 2023 21:38:07 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=80=E3=82=A4=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=82=92Astro=E3=81=AE=E3=83=AA=E3=83=80=E3=82=A4?= =?UTF-8?q?=E3=83=AC=E3=82=AF=E3=83=88=E6=A9=9F=E8=83=BD=E3=81=AB=E7=A7=BB?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astro.config.ts | 17 ++++++++++++++++ src/pages/[...path].astro | 43 --------------------------------------- 2 files changed, 17 insertions(+), 43 deletions(-) delete mode 100644 src/pages/[...path].astro diff --git a/astro.config.ts b/astro.config.ts index 7f39513..9bcac07 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -8,6 +8,23 @@ import prefetch from '@astrojs/prefetch' export default defineConfig({ site: 'https://oucc.org', compressHTML: true, + // 旧ウェブサイトでよくアクセスされていたURLにリダイレクトを設定する + redirects: { + '/about.html': '/', + '/access.html': '/', + '/activity.html': '/activity/', + '/contact.html': '/contact/', + '/join.html': '/join/', + '/link.html': '/', + '/member.html': '/', + '/part.html': '/', + '/welcomeevent.html': '/', + '/group/programming': '/', + '/group/programming/about.html': '/', + '/group/programming/activity.html': '/', + '/group/programming/works.html': '/', + '/group/handaitaisen/handai_taisen.html': '/', + }, integrations: [ image({ serviceEntryPoint: '@astrojs/image/sharp' }), tailwind(), diff --git a/src/pages/[...path].astro b/src/pages/[...path].astro deleted file mode 100644 index ecb62b6..0000000 --- a/src/pages/[...path].astro +++ /dev/null @@ -1,43 +0,0 @@ ---- -// 旧ウェブサイトでよくアクセスされていたURLにリダイレクトを設定する - -export function getStaticPaths() { - if (Astro.site === undefined) { - throw new Error( - 'ウェブサイトのURLが設定されていません。astro.config.tsで指定してください。', - ) - } - - const pages = [ - ['about.html', '/'], - ['access.html', '/'], - ['activity.html', '/activity/'], - ['contact.html', '/contact/'], - ['join.html', '/join/'], - ['link.html', '/'], - ['member.html', '/'], - ['part.html', '/'], - ['welcomeevent.html', '/'], - ['group/programming', '/'], - ['group/programming/about.html', '/'], - ['group/programming/activity.html', '/'], - ['group/programming/works.html', '/'], - ['group/handaitaisen/handai_taisen.html', '/'], - ] as const - - return pages.map(([from, to]) => ({ - params: { path: from }, - props: { destination: new URL(to, Astro.site) }, - })) -} - -interface Props { - destination: URL -} - -const { destination } = Astro.props ---- - - - -