-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro.config.mjs
109 lines (105 loc) · 2.82 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import { defineConfig, passthroughImageService } from "astro/config";
import starlight from "@astrojs/starlight";
import tailwind from "@astrojs/tailwind";
import { favicons } from "favicons";
const base = "/nemo-doc";
async function faviconPlugin(options) {
const icons = await favicons(
"./logo/build/without-text/nemo-logo-rusty-nomargin.svg",
options,
);
return {
name: "vite-plugin-favicons",
order: "pre",
sequential: true,
transform(src, id) {
if (id.endsWith("@astrojs/starlight/components/Page.astro")) {
src = src.replace("</head>", icons.html.join("") + "</head>");
}
return src;
},
configureServer(server) {
for (const icon of icons.images) {
server.middlewares.use(`/${icon.name}`, (req, res) => {
res.end(icon.contents);
});
}
},
generateBundle(options, bundle) {
for (const icon of icons.images) {
bundle[icon.name] = {
type: "asset",
fileName: icon.name,
source: icon.contents,
};
}
},
};
}
// https://astro.build/config
export default defineConfig({
site: "https://knowsys.github.io/",
base,
outDir: "./dist/nemo-doc",
integrations: [
starlight({
title: "Nemo",
customCss: [
"./src/tailwind.css",
"./src/styles/custom.css",
// Fontsource files for to regular and semi-bold font weights.
"@fontsource/comfortaa/400.css",
"@fontsource/comfortaa/600.css",
],
favicon: "/favicon.svg",
social: {
github: "https://github.com/knowsys/nemo",
},
components: {
SiteTitle: "./src/components/SiteTitle.astro",
},
sidebar: [
{
label: "Guides",
items: [
// Each item here is one entry in the navigation menu.
{ label: "Installing", slug: "guides/installing" },
{ label: "Command Line", slug: "guides/cli" },
{ label: "Rule Language", slug: "guides/tour" },
{ label: "Browser Integration", slug: "guides/wasm" },
{ label: "Python API", slug: "guides/python" },
],
},
{
label: "Language Reference",
// todo: reorder
autogenerate: { directory: "reference" },
},
],
}),
tailwind(),
],
image: { service: passthroughImageService() },
vite: {
plugins: [
faviconPlugin({
path: base,
background: "#134e4a",
icons: {
favicons: [
"favicon.svg",
"favicon.ico",
"favicon-16x16.png",
"favicon-32x32.png",
"favicon-48x48.png",
],
android: false,
appleIcon: true,
appleStartup: false,
windows: false,
yandex: false,
},
}),
],
},
});