-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.ts
121 lines (117 loc) · 3.05 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";
import { defineConfig } from "astro/config";
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
import expressiveCode from "astro-expressive-code";
import purgecss from "astro-purgecss";
import { h } from "hastscript";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypeKatex from "rehype-katex";
import rehypeMermaid from "rehype-mermaid";
import rehypeSlug from "rehype-slug";
import rehypeUnwrapImages from "rehype-unwrap-images";
import remarkRuby from "remark-denden-ruby";
import remarkGemoji from "remark-gemoji";
import remarkMath from "remark-math";
import rehypeBudoux from "./src/lib/rehype-budoux";
import rehypePagefind from "./src/lib/rehype-pagefind";
import remarkFootnoteTitle from "./src/lib/remark-footnote-title";
import remarkImagePlaceholder from "./src/lib/remark-image-placeholder";
import remarkLinkcard from "./src/lib/remark-link-card";
import type { Element } from "hast";
export default defineConfig({
integrations: [
expressiveCode({
themes: ["github-dark-default", "github-light-default"],
plugins: [pluginLineNumbers()],
defaultProps: {
showLineNumbers: false,
},
shiki: {
langs: [
async () =>
await fetch(
"https://raw.githubusercontent.com/caddyserver/vscode-caddyfile/refs/heads/master/syntaxes/caddyfile.tmLanguage.json",
{ cache: "force-cache" },
).then((res) => res.json()),
],
},
}),
mdx(),
sitemap(),
purgecss({
fontFace: true,
safelist: [/:hover$/],
}),
],
build: {
format: "file",
},
prefetch: {
defaultStrategy: "viewport",
prefetchAll: true,
},
markdown: {
syntaxHighlight: false,
smartypants: false,
remarkPlugins: [
remarkGemoji,
remarkMath,
remarkRuby,
remarkLinkcard,
remarkFootnoteTitle,
remarkImagePlaceholder,
],
remarkRehype: {
footnoteLabel: "脚注",
footnoteBackLabel: "戻る",
},
rehypePlugins: [
rehypeSlug,
rehypeUnwrapImages,
[
rehypeAutolinkHeadings,
{
behavior: "append",
properties(node: Element) {
return {
"aria-labelledby": node.properties.id,
class: "heading-link",
};
},
content: h("span.heading-link-icon", {
title: "リンク",
}),
},
],
[
rehypeMermaid,
{
strategy: "img-svg",
dark: {
theme: "dark",
fontFamily: "monospace",
},
mermaidConfig: {
fontFamily: "monospace",
},
launchOptions: {
channel: "chrome",
},
},
],
rehypeBudoux,
rehypeKatex,
rehypePagefind,
],
},
image: {
remotePatterns: [{ protocol: "https" }],
},
site: "https://www.haxibami.net",
experimental: {
svg: {
mode: "inline",
},
},
});