-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathastro.config.mjs
92 lines (90 loc) · 2.07 KB
/
astro.config.mjs
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
import { defineConfig } from "astro/config"
import react from "@astrojs/react"
import starlight from "@astrojs/starlight"
import { rehypeHeadingIds } from "@astrojs/markdown-remark"
import rehypeAutolinkHeadings from "rehype-autolink-headings"
import remarkTextr from "remark-textr"
import compressor from "astro-compressor"
// https://astro.build/config
export default defineConfig({
compressHTML: false,
devToolbar: {
enabled: false,
},
markdown: {
shikiConfig: {
// Choose from Shiki's built-in themes (or add your own)
// https://shiki.style/themes
themes: {
light: "github-light",
dark: "github-dark",
},
},
rehypePlugins: [
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
// Wrap the heading text in a link.
behavior: "wrap",
},
],
],
remarkPlugins: [
[
remarkTextr,
{
plugins: [frenchPunctuation],
options: {
locale: "fr",
},
},
],
],
},
integrations: [
react(),
starlight({
title: "La Suite : intégrations",
social: {
github: "https://github.com/numerique-gouv/lasuite-integration",
},
defaultLocale: "root",
locales: {
root: {
label: "Français",
lang: "fr",
},
},
sidebar: [
{
label: "Guide",
autogenerate: {
directory: "guides",
},
},
{
label: "Référence",
autogenerate: {
directory: "reference",
},
},
{
label: "À propos",
autogenerate: {
directory: "about",
},
},
],
customCss: ["./src/styles/global.css"],
expressiveCode: {
themes: ["github-dark", "github-light"],
},
}),
compressor(),
],
})
// replace all occurences of " :", " !", " ?", " ; " with a non-breaking space
function frenchPunctuation(input) {
return input.replace(/ (\?|\!|:|;)(\s|$)/gim, "\u202F$1$2")
}