-
Notifications
You must be signed in to change notification settings - Fork 3
/
astro.config.ts
37 lines (35 loc) · 1.14 KB
/
astro.config.ts
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
/* eslint-disable @cspell/spellchecker */
import { type RehypePlugin } from '@astrojs/markdown-remark';
import { transformerNotationDiff, transformerNotationHighlight } from '@shikijs/transformers';
import { transformerTwoslash } from '@shikijs/twoslash';
import { defineConfig } from 'astro/config';
import rehypeAttrs from 'rehype-attr';
import rehypeExternalLinks from 'rehype-external-links';
import type { ThemeRegistration } from 'shiki';
import { imagesPlugin } from './tools/images-plugin';
import shikiTheme from './tools/vscode-themes/noctis/minimus.json';
// https://astro.build/config
export default defineConfig({
outDir: 'dist',
markdown: {
shikiConfig: {
theme: shikiTheme as ThemeRegistration,
transformers: [
transformerTwoslash({ explicitTrigger: true }),
transformerNotationDiff(),
transformerNotationHighlight(),
],
},
remarkRehype: {
allowDangerousHtml: true,
},
rehypePlugins: [
[rehypeAttrs as unknown as RehypePlugin, { properties: 'attr' }],
[rehypeExternalLinks, { target: '_blank', rel: 'noopener noreferrer' }],
],
},
server: { port: 4000 },
vite: {
plugins: [imagesPlugin()],
},
});