-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathastro.config.ts
More file actions
105 lines (100 loc) · 3.2 KB
/
astro.config.ts
File metadata and controls
105 lines (100 loc) · 3.2 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
101
102
103
104
105
import { defineConfig, passthroughImageService } from 'astro/config'
import starlight from '@astrojs/starlight'
import starlightBlog from 'starlight-blog'
import { remarkInlineHighlight } from './src/plugins/remarkInlineHighlight.js'
import pomskyGrammar from './src/plugins/grammars/pomsky.js'
import regexpGrammar from './src/plugins/grammars/regexp.js'
function meta(attrs: Record<string, any>) {
return { tag: 'meta', attrs } as const
}
function link(attrs: Record<string, any>) {
return { tag: 'link', attrs } as const
}
function googleFonts(...families: string[]) {
return link({
rel: 'stylesheet',
href: `https://fonts.googleapis.com/css2?family=${families.join('&family=')}&display=swap`,
})
}
// https://astro.build/config
export default defineConfig({
site: 'https://pomsky-lang.org',
markdown: {
remarkPlugins: [remarkInlineHighlight],
syntaxHighlight: 'shiki',
},
image: {
service: passthroughImageService(),
},
integrations: [
starlight({
plugins: [
starlightBlog({
title: 'Pomsky Blog',
navigation: 'none',
metrics: { readingTime: true },
}),
],
title: 'Pomsky',
logo: { src: './src/assets/favicon.svg' },
editLink: { baseUrl: 'https://github.com/pomsky-lang/website/edit/main' },
defaultLocale: 'en',
lastUpdated: true,
customCss: ['./src/styles/global.css'],
routeMiddleware: './src/routeData.ts',
head: [
// theme colors
meta({ name: 'theme-color', content: '#fff' }),
meta({ name: 'msapplication-TileColor', content: '#fff' }),
// favicon
link({ rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }),
// web manifest
link({ rel: 'manifest', href: '/site.webmanifest' }),
// fonts
link({ rel: 'preconnect', href: 'https://fonts.googleapis.com' }),
link({ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }),
googleFonts('Inter:wght@400;500;600;800', 'JetBrains+Mono:wght@400;700'),
],
sidebar: [
{
label: 'Get Started',
autogenerate: { directory: 'docs/get-started' },
},
{
label: 'Language Tour',
autogenerate: { directory: 'docs/language-tour' },
collapsed: true,
},
{
label: 'Reference',
autogenerate: { directory: 'docs/reference' },
collapsed: true,
},
{
label: 'Examples',
autogenerate: { directory: 'docs/examples' },
collapsed: true,
},
{
label: 'Appendix',
autogenerate: { directory: 'docs/appendix' },
collapsed: true,
},
],
components: {
SocialIcons: './src/components/SocialIcons.astro',
},
// see <SocialIcons />
// social: [
// { icon: 'github', label: 'GitHub', href: 'https://github.com/pomsky-lang/pomsky' },
// { icon: 'discord', label: 'Discord', href: 'https://discord.gg/uwap2uxMFp' },
// ],
expressiveCode: {
themes: ['dark-plus', 'light-plus'],
shiki: {
langs: [pomskyGrammar, regexpGrammar],
},
},
}),
],
})