Files
integration/website/astro.config.mjs

93 lines
2.1 KiB
JavaScript
Raw Normal View History

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: {
2024-06-06 14:13:34 +02:00
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",
},
},
2024-06-06 14:13:34 +02:00
{
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")
}