From 8846050a71d22e508cb4a563e32caea6ee5ef88a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=89=E9=87=8E=E6=95=AC=E5=A4=AA=E9=83=8E?= Date: Mon, 16 Sep 2024 19:33:32 +0900 Subject: [PATCH] =?UTF-8?q?middleware=E3=81=AB=E6=88=BB=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astro.config.mjs | 4 +++- {src/functions => functions}/post/_middleware.tsx | 3 --- src/pages/404.astro | 8 ++++++++ 3 files changed, 11 insertions(+), 4 deletions(-) rename {src/functions => functions}/post/_middleware.tsx (99%) create mode 100644 src/pages/404.astro diff --git a/astro.config.mjs b/astro.config.mjs index cb9c3ee..3a16534 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -19,7 +19,9 @@ export default defineConfig({ }, }, output: "hybrid", - adapter: cloudflare(), + adapter: cloudflare({ + mode: "directory", + }), build: { inlineStylesheets: "auto", }, diff --git a/src/functions/post/_middleware.tsx b/functions/post/_middleware.tsx similarity index 99% rename from src/functions/post/_middleware.tsx rename to functions/post/_middleware.tsx index 43e7e10..c4d5be9 100644 --- a/src/functions/post/_middleware.tsx +++ b/functions/post/_middleware.tsx @@ -82,7 +82,6 @@ const OgImage = ({ ogTitle }: OgImageProps): JSX.Element => { ); }; - const getFontData = async (url: string): Promise => { const css = await ( await fetch(url, { @@ -92,11 +91,9 @@ const getFontData = async (url: string): Promise => { }, }) ).text(); - const resource = css.match( /src: url\((.+)\) format\('(opentype|truetype)'\)/ ); - if (resource === null) { throw new Error("Font resource not found"); } diff --git a/src/pages/404.astro b/src/pages/404.astro new file mode 100644 index 0000000..248188e --- /dev/null +++ b/src/pages/404.astro @@ -0,0 +1,8 @@ +--- +import Layout from "../layouts/Layout.astro"; +--- + + +

404 Not Found

+

ページが見つかりませんでした。

+