From 90f394ff694d19dafa7e8f103c750171ffaa48c2 Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Thu, 22 May 2025 05:10:58 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20`sitemap.xml`=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/src/index.tsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/website/src/index.tsx b/website/src/index.tsx index 90b9f473e3..eeda7826d0 100644 --- a/website/src/index.tsx +++ b/website/src/index.tsx @@ -66,4 +66,27 @@ flattenedPages.forEach((page, pageIndex) => { }); }); +app.get("/sitemap.xml", (c) => { + const routes = ["/", ...flattenedPages.map((page) => page.route)]; + const today = new Date(); + const formattedDate = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, "0")}-${String(today.getDate()).padStart(2, "0")}`; + + const sitemap = ` + +${routes + .map( + (route) => ` + https://typst-jp.github.io${route} + ${formattedDate} + `, + ) + .join("\n")} + +`; + + return c.text(sitemap, 200, { + "Content-Type": "application/xml", + }); +}); + export default app; From 5133c319b2eab9a03165e69c7bef4dca780cb1e4 Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Thu, 22 May 2025 05:15:43 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20`robots.txt`=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/src/index.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/src/index.tsx b/website/src/index.tsx index eeda7826d0..1361ec6e5b 100644 --- a/website/src/index.tsx +++ b/website/src/index.tsx @@ -89,4 +89,16 @@ ${routes }); }); +app.get("/robots.txt", (c) => { + const robotsTxt = `User-agent: * +Allow: / + +Sitemap: https://typst-jp.github.io/sitemap.xml +`; + + return c.text(robotsTxt, 200, { + "Content-Type": "text/plain", + }); +}); + export default app; From e0345471cda25be809c1ce7c68fceaa1ed751d3e Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Thu, 22 May 2025 05:23:42 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E3=82=B5=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=83=9E=E3=83=83=E3=83=97=E3=81=AE=E3=83=A1=E3=82=BF=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- website/src/components/templates/BaseTemplate.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/src/components/templates/BaseTemplate.tsx b/website/src/components/templates/BaseTemplate.tsx index 5feed39979..104f4125e2 100644 --- a/website/src/components/templates/BaseTemplate.tsx +++ b/website/src/components/templates/BaseTemplate.tsx @@ -64,6 +64,8 @@ export const BaseTemplate: FC = ({ + +