diff --git a/functions/post/og/[ogtitle].tsx b/functions/post/og/[ogtitle].tsx deleted file mode 100644 index ec7dd6f..0000000 --- a/functions/post/og/[ogtitle].tsx +++ /dev/null @@ -1,129 +0,0 @@ -import React from "react"; -import { ImageResponse } from "@cloudflare/pages-plugin-vercel-og/api"; - -interface OgImageProps { - ogTitle: string; -} - -const OgImage = ({ ogTitle }: OgImageProps): JSX.Element => { - return ( -
-
-

{ogTitle}

-
-

- - - - - - ゆっきー -

-

- ゆっきーの砂場 -

-
-
-
- ); -}; - -const getFontData = async (url: string): Promise => { - const css = await ( - await fetch(url, { - headers: { - "User-Agent": - "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1", - }, - }) - ).text(); - - const resource = css.match( - /src: url\((.+)\) format\('(opentype|truetype)'\)/ - ); - - if (resource === null) { - throw new Error("Font resource not found"); - } - - return await fetch(resource[1]).then(async (res) => await res.arrayBuffer()); -}; - -export const onRequest = async (context) => { - const notoSansJpUrl = `https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@600`; - const reggeaeOneUlr = - "https://fonts.googleapis.com/css2?family=Reggae+One&display=swap&text=ゆっきーの砂場"; - const notoSansJpFontData = await getFontData(notoSansJpUrl); - const reggeaeOneFontData = await getFontData(reggeaeOneUlr); - return new ImageResponse(, { - width: 800, - height: 400, - fonts: [ - { - name: "Noto Sans JP", - data: notoSansJpFontData, - style: "normal", - }, - { - name: "Reggae One", - data: reggeaeOneFontData, - style: "normal", - }, - ], - }); -}; diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 2e5628f..aac05f6 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -27,9 +27,6 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site); - - -