-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathastro.config.mjs
More file actions
100 lines (95 loc) · 3.13 KB
/
Copy pathastro.config.mjs
File metadata and controls
100 lines (95 loc) · 3.13 KB
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
// @ts-check
import { unified } from "@astrojs/markdown-remark";
import starlight from "@astrojs/starlight";
import { defineConfig } from "astro/config";
import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links";
import { viteStaticCopy } from "vite-plugin-static-copy";
import remarkWrapImagesWithOriginals from "./src/plugins/remark-wrap-images-with-originals.ts";
import { generateSidebar } from "./src/plugins/summary-to-sidebar.ts";
const base = "tech-docs";
const site = import.meta.env.PROD
? `https://system76.com/${base}`
: `http://localhost:4321/${base}`;
// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: "System76 Technical Documentation",
logo: {
light: "./src/assets/img/system76_logo-light.svg",
dark: "./src/assets/img/system76_logo-dark.svg",
replacesTitle: true,
},
lastUpdated: true,
social: [
{
icon: "x.com",
label: "Twitter",
href: "https://x.com/system76",
},
{
icon: "linkedin",
label: "LinkedIn",
href: "https://www.linkedin.com/company/system76",
},
{
icon: "reddit",
label: "reddit",
href: "https://www.reddit.com/r/System76/",
},
{
icon: "github",
label: "GitHub",
href: "https://github.com/system76",
},
],
sidebar: generateSidebar(
new URL("./src/SUMMARY.md", import.meta.url).pathname,
),
tableOfContents: false, // Turned on per-page.
favicon: "/favicon.png",
customCss: [
"./src/assets/css/variables.css",
"./src/assets/css/img-background.css",
"./src/assets/css/toc-width-fix.css",
],
locales: {
root: {
label: "English",
lang: "en",
},
},
routeMiddleware: "./src/plugins/toc-formatting-middleware.ts",
}),
],
base,
site,
image: {
service: {
entrypoint: "./src/avifImageService.mjs",
},
layout: "constrained",
responsiveStyles: true,
},
markdown: {
processor: unified({
remarkPlugins: [[remarkWrapImagesWithOriginals, { base }]],
rehypePlugins: [
[rehypeAstroRelativeMarkdownLinks, { base, collectionBase: false }],
],
}),
},
vite: {
plugins: [
viteStaticCopy({
targets: [
{
src: "src/content/docs/**/*.{jpg,jpeg,png,gif,webp,tiff,avif}",
dest: "originals",
rename: { stripBase: 3 },
},
],
}),
],
},
});