-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.mjs
139 lines (135 loc) · 4.69 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import alpinejs from '@astrojs/alpinejs';
import sitemap from '@astrojs/sitemap';
import starlight from '@astrojs/starlight';
import tailwind from '@astrojs/tailwind';
import AstroPWA from '@vite-pwa/astro';
import astroI18next from 'astro-i18next';
import icon from 'astro-icon';
import { defineConfig } from 'astro/config';
import axios from 'axios';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import { autolinkConfig } from './plugins/rehype-autolink-config';
async function fetchGrammar() {
const url = 'https://raw.githubusercontent.com/helixlang/helix-lsp/lsp-v1/public/syntaxes/helix.tmLanguage.json';
const response = await axios.get(url);
return response.data;
}
const grammar = await fetchGrammar();
export default defineConfig({
site: 'https://helix-lang.com',
vite: {
define: {
__DATE__: `'${new Date().toISOString()}'`
}
},
integrations: [
tailwind(),
sitemap(),
astroI18next(),
alpinejs(),
AstroPWA({
mode: 'production',
base: '/',
scope: '/',
includeAssets: ['favicon.svg'],
registerType: 'autoUpdate',
manifest: {
name: 'Helix Website - This is the website for the Helix Programming Language',
short_name: 'Helix',
theme_color: '#ffffff',
icons: [
{ src: 'pwa-192x192.png', sizes: '192x192', type: 'image/png' },
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png' },
{ src: 'pwa-512x512.png', sizes: '512x512', type: 'image/png', purpose: 'any maskable' }
]
},
workbox: {
navigateFallback: '/404',
globPatterns: ['*.js']
},
devOptions: {
enabled: false,
navigateFallbackAllowlist: [/^\/404$/],
suppressWarnings: true
}
}),
icon(),
starlight({
title: 'Helix',
logo: {
src: "/public/logo.svg",
replacesTitle: false,
},
editLink: {
baseUrl: 'https://github.com/helixlang/helix-site/edit/new-template/src/content/docs/docs/',
},
social: {
github: 'https://github.com/helixlang/helix-lang',
},
customCss: ["/src/styles/docstyle.css"],
expressiveCode: {
themes: ['github-dark-default', 'github-light-default'],
shiki: {
langs: [
grammar
],
},
// border color should be #0b0e12
styleOverrides: { borderRadius: '0.3rem', borderWidth: '0rem', borderColor: '#0b0e12', gutterBorderColor: '#0b0e12', codeSelectionBackground: '#0b0e12', scrollbarThumbHoverColor: '#0b0e12', scrollbarThumbColor: '#0b0e12' },
},
sidebar: [
{
label: 'Welcome',
link: 'docs',
},
{
label: 'Philosophy',
link: 'docs/philosophy',
},
{
label: "Getting Started",
autogenerate: { "directory": "docs/getting-started" }
},
{
label: "Language",
autogenerate: { "directory": "docs/language" }
},
{
label: "Tooling",
autogenerate: { "directory": "docs/tooling" }
},
{
label: "Examples",
"badge": "New",
autogenerate: { "directory": "docs/examples" }
},
{
label: "Reference",
autogenerate: { "directory": "docs/reference" }
},
{
label: "Contributing",
autogenerate: { "directory": "docs/contributing" }
},
{
label: "FAQ",
autogenerate: { "directory": "docs/faq" }
}
],
tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 4 },
lastUpdated: true,
disable404Route: true,
})
],
markdown: {
rehypePlugins: [
rehypeSlug,
// This adds links to headings
[rehypeAutolinkHeadings, autolinkConfig]
]
},
experimental: {
contentCollectionCache: true
}
});