-
Notifications
You must be signed in to change notification settings - Fork 38
/
astro.config.ts
79 lines (78 loc) · 2.23 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
import { fileURLToPath } from "node:url";
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import { defineConfig } from "astro/config";
import yaml from "@rollup/plugin-yaml";
import remarkAttributeList from "remark-attribute-list";
import redirect from "./src/lib/RedirectIntegration.js";
import defaultFrontmatterPlugin from "./src/lib/DefaultFrontmatterPlugin.js";
import dotSlashPlugin from "./src/lib/DotSlashPlugin.js";
import simpleAttentionPlugin from "./src/lib/SimpleAttentionPlugin.js";
import externalLinks from "./src/lib/ExternalLinksIntegration.js";
import { cleanup } from "./src/lib/CleanupIntegration.js";
import collectHtmlImages from "./src/lib/CollectHtmlImagesPlugin.js";
import copyAsset from "./src/lib/CopyAssetIntegration.js";
import assetFileNames from "./src/lib/AssetFileNames.js";
import rehypeRaw from "rehype-raw";
// https://astro.build/config
export default defineConfig({
vite: {
plugins: [yaml()],
resolve: {
alias: {
"@styles": fileURLToPath(new URL("./src/styles", import.meta.url)),
},
},
server: {
watch: { usePolling: Boolean(process.env.USE_POLLING) },
},
build: {
rollupOptions: {
output: {
assetFileNames,
},
},
},
},
build: {
format: "preserve",
},
markdown: {
remarkPlugins: [
dotSlashPlugin,
[defaultFrontmatterPlugin, { layout: "@layouts/Layout.astro" }],
simpleAttentionPlugin,
[
remarkAttributeList,
{
allowNoSpaceBeforeName: true,
allowUnderscoreInId: true,
allowNoPosition: true,
},
],
],
remarkRehype: {
footnoteLabelProperties: { className: ["visually-hidden"] },
footnoteLabelTagName: "b",
},
rehypePlugins: [rehypeRaw, collectHtmlImages],
shikiConfig: {
theme: "min-light",
},
},
scopedStyleStrategy: "where",
integrations: [
mdx({ rehypePlugins: [] }),
react(),
redirect(),
externalLinks({
target: "_blank",
rel: ["noopener", "noreferrer"],
content: { type: "text", value: "" },
contentProperties: { className: ["external-link"] },
}),
cleanup(),
copyAsset(),
],
site: "https://utelecon.adm.u-tokyo.ac.jp",
});