Skip to content

Commit 9f4379b

Browse files
committed
use metadata.ts
1 parent 2314d2a commit 9f4379b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

website/src/metadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export const githubOrganizationUrl = "https://github.com/typst-jp";
77
export const githubRepositoryUrl =
88
"https://github.com/typst-jp/typst-jp.github.io";
99
export const discordServerUrl = "https://discord.gg/9xF7k4aAuH";
10+
export const baseUrl = "https://typst-jp.github.io/";

website/vite.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import devServer from "@hono/vite-dev-server";
77
import ssg from "@hono/vite-ssg";
88
import tailwindcss from "@tailwindcss/vite";
99
import { defineConfig } from "vite";
10+
import { baseUrl } from "./src/metadata";
1011

1112
// typst-docsが生成したドキュメントのアセットをassets/docsにシンボリックリンクする
1213
const assetsDocsPath = resolve(__dirname, "../assets/docs/");
@@ -15,17 +16,19 @@ const publicAssetsDocsPath = resolve(__dirname, "./public/assets/docs/");
1516
rmSync(publicAssetsDocsPath, { recursive: true, force: true });
1617
symlinkSync(assetsDocsPath, publicAssetsDocsPath, "dir");
1718

19+
const sitemapUrl = new URL("/sitemap.xml", baseUrl).href;
20+
1821
export default defineConfig({
1922
plugins: [
2023
tailwindcss(),
2124
ssg({
2225
plugins: [
2326
sitemapPlugin({
24-
baseUrl: "https://typst-jp.github.io/",
27+
baseUrl,
2528
}),
2629
robotsTxtPlugin({
2730
rules: [{ userAgent: "*", allow: ["/"] }],
28-
sitemapUrl: "https://typst-jp.github.io/sitemap.xml",
31+
sitemapUrl,
2932
}),
3033
],
3134
}),

0 commit comments

Comments
 (0)