-
Notifications
You must be signed in to change notification settings - Fork 2
/
astro.config.mjs
97 lines (95 loc) · 3.08 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
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */
import mdx from '@astrojs/mdx';
import prefetch from '@astrojs/prefetch';
import react from '@astrojs/react';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import { defineConfig } from 'astro/config';
import remarkEmbedder from '@remark-embedder/core';
import oembedTransformer from '@remark-embedder/transformer-oembed';
import { h } from 'hastscript';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeExternalLinks from 'rehype-external-links';
import remarkBreaks from 'remark-breaks';
import remarkUnwrapImages from 'remark-unwrap-images';
// https://astro.build/config
export default defineConfig({
site: import.meta.env.DEV ? 'http://localhost:8000' : 'https://yrnana.dev',
trailingSlash: 'never',
output: 'static',
vite: {
resolve: {
alias: {
'~/': `${process.cwd()}/src/`,
},
},
server: {
open: true,
},
},
server: {
port: 8000,
host: true,
},
markdown: {
gfm: true,
remarkPlugins: [
remarkBreaks,
remarkUnwrapImages, // paragraph unwrap
[
remarkEmbedder,
{
transformers: [oembedTransformer],
},
],
],
rehypePlugins: [
[
rehypeExternalLinks,
{
target: '_blank',
},
],
[
rehypeAutolinkHeadings,
{
behavior: 'append',
properties: {
class: 'autolink',
ariaHidden: true,
tabIndex: -1,
},
content: h(
'svg',
{
xmlns: 'http://www.w3.org/2000/svg',
fill: 'currentColor',
width: 24,
height: 24,
viewBox: '0 0 24 24',
},
h('path', {
d: 'M9.199 13.599a5.99 5.99 0 0 0 3.949 2.345 5.987 5.987 0 0 0 5.105-1.702l2.995-2.994a5.992 5.992 0 0 0 1.695-4.285 5.976 5.976 0 0 0-1.831-4.211 5.99 5.99 0 0 0-6.431-1.242 6.003 6.003 0 0 0-1.905 1.24l-1.731 1.721a.999.999 0 1 0 1.41 1.418l1.709-1.699a3.985 3.985 0 0 1 2.761-1.123 3.975 3.975 0 0 1 2.799 1.122 3.997 3.997 0 0 1 .111 5.644l-3.005 3.006a3.982 3.982 0 0 1-3.395 1.126 3.987 3.987 0 0 1-2.632-1.563A1 1 0 0 0 9.201 13.6zm5.602-3.198a5.99 5.99 0 0 0-3.949-2.345 5.987 5.987 0 0 0-5.105 1.702l-2.995 2.994a5.992 5.992 0 0 0-1.695 4.285 5.976 5.976 0 0 0 1.831 4.211 5.99 5.99 0 0 0 6.431 1.242 6.003 6.003 0 0 0 1.905-1.24l1.723-1.723a.999.999 0 1 0-1.414-1.414L9.836 19.81a3.985 3.985 0 0 1-2.761 1.123 3.975 3.975 0 0 1-2.799-1.122 3.997 3.997 0 0 1-.111-5.644l3.005-3.006a3.982 3.982 0 0 1 3.395-1.126 3.987 3.987 0 0 1 2.632 1.563 1 1 0 0 0 1.602-1.198z',
}),
),
},
],
],
syntaxHighlight: 'shiki',
shikiConfig: {
theme: 'one-dark-pro',
wrap: false,
},
},
integrations: [
mdx(),
react(),
prefetch(),
sitemap({
changefreq: 'weekly',
priority: 0.7,
filter: (page) => !page.includes('/page/'),
}),
tailwind(),
],
});