-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathastro.config.ts
80 lines (79 loc) · 2.42 KB
/
astro.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { defineConfig } from "astro/config"
import tailwind from "@astrojs/tailwind"
import solidJs from "@astrojs/solid-js"
import mdx from "@astrojs/mdx"
import { remarkCallout } from "./src/lib/remark-plugins/remarkCallout"
import { remarkLinkCard } from "./src/lib/remark-plugins/remarkLinkCard"
import {
rehypeCustomCode,
type RehypeCustomCodeOptions,
transformerDiff,
transformerHighlightLine,
transformerLineNumbers,
} from "rehype-custom-code"
import { remarkMetaString } from "remark-meta-string"
import {
googleSlidesTransformer,
oEmbedTransformer,
remarkEmbed,
youTubeTransformer,
type RemarkEmbedOptions,
} from "./src/lib/remark-plugins/remarkEmbed"
import remarkMath from "remark-math"
import rehypeKatex from "rehype-katex"
import { pagefind } from "./src/lib/astro-integrations/pagefind"
import sitemap from "@astrojs/sitemap"
import { remarkInlineCode } from "./src/lib/remark-plugins/remarkInlineCode"
// https://astro.build/config
export default defineConfig({
site: "https://alg.tus-ricora.com/",
redirects: {
// NOTE: Astroのバグで誤ったリダイレクト用のページが生成されるので、解決されるまでこの設定は無効化し、手動でリダイレクト用のページを生成する
//"/p/[...slug]": "/posts/[...slug]",
"/link": "/links",
"/about-us": "/about",
"/posts": "/archives",
},
integrations: [tailwind(), solidJs(), mdx(), sitemap(), pagefind()],
markdown: {
remarkPlugins: [
remarkMath,
remarkInlineCode,
remarkCallout,
remarkMetaString,
[
remarkEmbed,
{
transformers: [youTubeTransformer, googleSlidesTransformer, oEmbedTransformer],
} satisfies RemarkEmbedOptions,
],
remarkLinkCard,
],
rehypePlugins: [
rehypeKatex,
[
rehypeCustomCode,
{
propsPrefix: "",
shouldExportCodeAsProps: true,
shiki: {
themes: {
light: "github-light",
dark: "one-dark-pro",
},
transformers: (meta) => [
transformerLineNumbers(meta, "data"),
transformerHighlightLine(meta, "data"),
transformerDiff(meta, "data"),
],
},
} satisfies RehypeCustomCodeOptions,
],
],
remarkRehype: {
footnoteLabel: "脚注",
footnoteLabelTagName: "span",
},
syntaxHighlight: false,
},
})