86 lines
2.9 KiB
TypeScript
86 lines
2.9 KiB
TypeScript
import { rehypeHeadingIds } from '@astrojs/markdown-remark'
|
|
import mdx from '@astrojs/mdx'
|
|
import react from '@astrojs/react'
|
|
import sitemap from '@astrojs/sitemap'
|
|
import tailwind from '@astrojs/tailwind'
|
|
import {
|
|
transformerMetaHighlight,
|
|
transformerNotationDiff,
|
|
transformerRenderWhitespace,
|
|
} from '@shikijs/transformers'
|
|
import { defineConfig } from 'astro/config'
|
|
import rehypeKatex from 'rehype-katex'
|
|
import rehypeExternalLinks from 'rehype-external-links'
|
|
import rehypePrettyCode from 'rehype-pretty-code'
|
|
import remarkEmoji from 'remark-emoji'
|
|
import remarkMath from 'remark-math'
|
|
import remarkToc from 'remark-toc'
|
|
import sectionize from '@hbsnow/rehype-sectionize'
|
|
import { transformerNotationSkip } from './src/lib/transformerNotationSkip'
|
|
import { transformerDiffHighlight } from './src/lib/transformerDiffHighlight'
|
|
import { transformerCopyButton } from './src/lib/transformerCopyButton'
|
|
|
|
import icon from 'astro-icon'
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
site: 'https://dev.2ha.me',
|
|
integrations: [
|
|
tailwind({
|
|
applyBaseStyles: false,
|
|
}),
|
|
sitemap(),
|
|
mdx(),
|
|
react(),
|
|
icon(),
|
|
],
|
|
markdown: {
|
|
syntaxHighlight: false,
|
|
rehypePlugins: [
|
|
[
|
|
rehypeExternalLinks,
|
|
{
|
|
target: '_blank',
|
|
rel: ['nofollow', 'noreferrer', 'noopener'],
|
|
},
|
|
],
|
|
rehypeHeadingIds,
|
|
[
|
|
rehypeKatex,
|
|
{
|
|
strict: false,
|
|
},
|
|
],
|
|
sectionize as any,
|
|
[
|
|
rehypePrettyCode,
|
|
{
|
|
theme: {
|
|
light: 'everforest-dark',
|
|
dark: 'everforest-dark',
|
|
},
|
|
transformers: [
|
|
transformerNotationDiff(),
|
|
transformerMetaHighlight(),
|
|
transformerRenderWhitespace(),
|
|
transformerNotationSkip(),
|
|
transformerDiffHighlight(),
|
|
transformerCopyButton({
|
|
duration: 1000,
|
|
successIcon: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(5,223,114,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E",
|
|
copyIcon: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E",
|
|
})
|
|
],
|
|
},
|
|
],
|
|
],
|
|
remarkPlugins: [remarkToc, remarkMath, remarkEmoji],
|
|
},
|
|
server: {
|
|
port: 1234,
|
|
host: true,
|
|
},
|
|
devToolbar: {
|
|
enabled: false,
|
|
},
|
|
}) |