-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
103 lines (100 loc) · 2.79 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
// @ts-check
import { defineConfig, passthroughImageService } from 'astro/config';
import starlight from '@astrojs/starlight';
import sitemap from "@astrojs/sitemap";
import starlightUtils from "@lorenzo_lewis/starlight-utils";
import starlightLinksValidator from 'starlight-links-validator'
import starlightOpenAPI from 'starlight-openapi'
import inlineSVGs from "./astro-inline-svgs.mjs";
import { sidebar } from "./src/sidebar";
import { bundledLanguages } from 'shiki'
// TODO: make this a submodule and track the latest version.
import tqlLang from './tql.tmLanguage.json' assert { type: 'json' };
const runLinkCheck = process.env.RUN_LINK_CHECK || false;
// https://astro.build/config
export default defineConfig({
// TODO: set to https://docs.tenzir.com and remove `base`.
site: 'https://tenzir.github.io',
base: 'docs',
integrations: [
sitemap({
serialize(item) {
item.lastmod = new Date().toISOString();
return item;
},
}),
starlight({
pagination: false,
plugins: [
...(runLinkCheck
? [
starlightLinksValidator({
//errorOnInvalidHashes: false,
//errorOnLocalLinks: false,
exclude: [
"/api/",
],
}),
]
: []),
starlightUtils({
multiSidebar: {
switcherStyle: 'hidden'
},
navLinks: {
leading: { useSidebarLabelled: 'navbar' }
}
}),
starlightOpenAPI([
{
base: 'api/node',
label: 'Node API',
// TODO: Something should auto-generate the spec and update this
// file automatically.
schema: './src/content/apis/openapi.node.yaml',
},
//{
// base: 'api/platform',
// label: 'Platform API',
// schema: './src/content/apis/openapi.platform.yaml',
//},
]),
],
title: 'Tenzir',
logo: {
light: './src/assets/tenzir-light.svg',
dark: './src/assets/tenzir-dark.svg',
replacesTitle: true,
},
customCss: ['./src/assets/styles.css'],
social: {
github: 'https://github.com/tenzir/tenzir',
discord: 'https://discord.tenzir.com',
linkedin: 'https://linkedin.com/company/tenzir',
},
sidebar,
lastUpdated: true,
}),
inlineSVGs(),
],
markdown: {
shikiConfig: {
themes: {
light: 'github-light',
dark: 'github-dark',
},
langs: [
{
id: 'tql',
scopeName: 'source.tql',
...tqlLang,
},
...Object.keys(bundledLanguages),
],
},
},
// Disable built-in image optimization.
image: {
service: passthroughImageService(),
},
});