aboutsummaryrefslogtreecommitdiffstats
path: root/astro.config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'astro.config.ts')
-rw-r--r--astro.config.ts107
1 files changed, 107 insertions, 0 deletions
diff --git a/astro.config.ts b/astro.config.ts
new file mode 100644
index 0000000..38a6cc1
--- /dev/null
+++ b/astro.config.ts
@@ -0,0 +1,107 @@
+import { defineConfig } from 'astro/config'
+
+import mdx from '@astrojs/mdx'
+import react from '@astrojs/react'
+import sitemap from '@astrojs/sitemap'
+import icon from 'astro-icon'
+
+import { rehypeHeadingIds } from '@astrojs/markdown-remark'
+import rehypeExpressiveCode from 'rehype-expressive-code'
+import rehypeExternalLinks from 'rehype-external-links'
+import rehypeKatex from 'rehype-katex'
+import rehypeShiki from '@shikijs/rehype'
+import remarkEmoji from 'remark-emoji'
+import remarkMath from 'remark-math'
+
+import { pluginCollapsibleSections } from '@expressive-code/plugin-collapsible-sections'
+import { pluginLineNumbers } from '@expressive-code/plugin-line-numbers'
+import type { ExpressiveCodeTheme } from 'rehype-expressive-code'
+
+import tailwindcss from '@tailwindcss/vite'
+
+export default defineConfig({
+ site: 'https://astro-erudite.vercel.app',
+ integrations: [mdx(), react(), sitemap(), icon()],
+ vite: {
+ plugins: [tailwindcss()],
+ },
+ server: {
+ port: 1234,
+ host: true,
+ },
+ devToolbar: {
+ enabled: false,
+ },
+ markdown: {
+ syntaxHighlight: false,
+ rehypePlugins: [
+ [
+ rehypeExternalLinks,
+ {
+ target: '_blank',
+ rel: ['nofollow', 'noreferrer', 'noopener'],
+ },
+ ],
+ rehypeHeadingIds,
+ rehypeKatex,
+ [
+ rehypeExpressiveCode,
+ {
+ themes: ['github-light', 'github-dark'],
+ plugins: [pluginCollapsibleSections(), pluginLineNumbers()],
+ useDarkModeMediaQuery: false,
+ themeCssSelector: (theme: ExpressiveCodeTheme) =>
+ `[data-theme="${theme.name.split('-')[1]}"]`,
+ defaultProps: {
+ wrap: true,
+ collapseStyle: 'collapsible-auto',
+ overridesByLang: {
+ 'ansi,bat,bash,batch,cmd,console,powershell,ps,ps1,psd1,psm1,sh,shell,shellscript,shellsession,text,zsh':
+ {
+ showLineNumbers: false,
+ },
+ },
+ },
+ styleOverrides: {
+ codeFontSize: '0.75rem',
+ borderColor: 'var(--border)',
+ codeFontFamily: 'var(--font-mono)',
+ codeBackground:
+ 'color-mix(in oklab, var(--muted) 25%, transparent)',
+ frames: {
+ editorActiveTabForeground: 'var(--muted-foreground)',
+ editorActiveTabBackground:
+ 'color-mix(in oklab, var(--muted) 25%, transparent)',
+ editorActiveTabIndicatorBottomColor: 'transparent',
+ editorActiveTabIndicatorTopColor: 'transparent',
+ editorTabBorderRadius: '0',
+ editorTabBarBackground: 'transparent',
+ editorTabBarBorderBottomColor: 'transparent',
+ frameBoxShadowCssValue: 'none',
+ terminalBackground:
+ 'color-mix(in oklab, var(--muted) 25%, transparent)',
+ terminalTitlebarBackground: 'transparent',
+ terminalTitlebarBorderBottomColor: 'transparent',
+ terminalTitlebarForeground: 'var(--muted-foreground)',
+ },
+ lineNumbers: {
+ foreground: 'var(--muted-foreground)',
+ },
+ uiFontFamily: 'var(--font-sans)',
+ },
+ },
+ ],
+ [
+ rehypeShiki,
+ {
+ themes: {
+ light: 'github-light',
+ dark: 'github-dark',
+ },
+ inline: 'tailing-curly-colon',
+ },
+ ],
+ ],
+ remarkPlugins: [remarkMath, remarkEmoji],
+ },
+})