-
Notifications
You must be signed in to change notification settings - Fork 1
/
astro.config.ts
71 lines (68 loc) · 2.35 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
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
import partytown from '@astrojs/partytown';
import solidJs from '@astrojs/solid-js';
import tailwind from '@astrojs/tailwind';
import expressiveCode from 'astro-expressive-code';
import { defineConfig } from 'astro/config';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import colors from 'tailwindcss/colors';
import { externalLinks, stripLineBreaks } from './plugins/remark.ts';
const site = import.meta.env.PROD
? 'https://blog.tsuki-yo.net'
: 'http://localhost:4321';
const textBg = (theme: string) =>
theme === 'material-theme'
? colors.gray[950] // black-knight
: colors.white;
// https://astro.build/config
export default defineConfig({
site,
trailingSlash: 'never', // to match the DEV and PROD environment
prefetch: {
prefetchAll: true,
},
markdown: {
remarkPlugins: [stripLineBreaks, externalLinks(site)],
rehypePlugins: [
rehypeSlug,
[
rehypeAutolinkHeadings,
{
behavior: 'wrap',
properties: {
class: 'anchor',
},
},
],
],
},
integrations: [
solidJs(),
tailwind({
applyBaseStyles: false,
}),
partytown(),
expressiveCode({
themes: ['material-theme', 'material-theme-lighter'],
themeCssSelector: ({ type }) => `[data-theme='${type}']`,
useDarkModeMediaQuery: false,
useThemedScrollbars: false,
styleOverrides: {
borderRadius: '0.5rem', // rounded-lg
codeBackground: ({ theme }) => textBg(theme.name),
frames: {
editorActiveTabBackground: ({ theme }) =>
textBg(theme.name),
editorActiveTabBorderColor: ({ theme }) =>
textBg(theme.name),
editorTabBarBackground: ({ theme }) =>
theme.name === 'material-theme'
? colors.slate[800]
: colors.slate[100],
editorActiveTabIndicatorBottomColor: colors.cyan[500], // maldives
shadowColor: 'transparent',
},
},
}),
],
});