chore: delete unused dependencies

This commit is contained in:
radishzzz 2025-03-19 22:03:26 +00:00
parent dc24da0cb7
commit 830c330b3a
4 changed files with 16 additions and 69 deletions

View file

@ -2,17 +2,14 @@
import mdx from '@astrojs/mdx'
import partytown from '@astrojs/partytown'
import sitemap from '@astrojs/sitemap'
import { transformerCopyButton } from '@rehype-pretty/transformers'
import compress from 'astro-compress'
import robotsTxt from 'astro-robots-txt'
// Rehype plugins (HTML processors)
import { defineConfig } from 'astro/config'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeComponents from 'rehype-components'
import rehypeExternalLinks from 'rehype-external-links'
import rehypeKatex from 'rehype-katex'
import rehypePrettyCode from 'rehype-pretty-code'
import rehypeSlug from 'rehype-slug'
// Remark plugins (Markdown processors)
@ -25,14 +22,9 @@ import remarkSectionize from 'remark-sectionize'
import UnoCSS from 'unocss/astro'
import { themeConfig } from './src/config'
import { langMap } from './src/i18n/config'
import { AdmonitionComponent } from './src/plugins/rehype-component-admonition'
import { GithubCardComponent } from './src/plugins/rehype-component-github-card'
import { parseDirectiveNode } from './src/plugins/remark-directive-rehype'
import { remarkExcerpt } from './src/plugins/remark-excerpt'
import { remarkReadingTime } from './src/plugins/remark-reading-time'
const url = themeConfig.site.url
const { light, dark } = themeConfig.color
const locale = themeConfig.global.locale
const linkPrefetch = themeConfig.preload.linkPrefetch
const imageDomain = new URL(themeConfig.preload.imageHostURL as string).hostname
@ -57,7 +49,9 @@ export default defineConfig({
defaultLocale: locale,
},
integrations: [
UnoCSS({ injectReset: true }),
UnoCSS({
injectReset: true,
}),
mdx(),
partytown({
config: {
@ -65,49 +59,20 @@ export default defineConfig({
},
}),
sitemap(),
robotsTxt({
sitemap: true,
}),
compress({
HTML: {
'html-minifier-terser': {
removeAttributeQuotes: false,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
sortAttributes: true,
sortClassName: true,
},
},
}),
robotsTxt(),
compress(),
],
markdown: {
remarkPlugins: [
remarkMath,
remarkDirective,
remarkGithubAdmonitionsToDirectives,
parseDirectiveNode,
remarkSectionize,
remarkReadingTime,
remarkExcerpt,
],
rehypePlugins: [
rehypeSlug,
rehypeKatex,
[
rehypePrettyCode,
{
theme: {
dark: dark.codeTheme,
light: light.codeTheme,
},
transformers: [
transformerCopyButton({
visibility: 'hover',
feedbackDuration: 2_500,
}),
],
},
],
[
rehypeExternalLinks,
{
@ -116,19 +81,6 @@ export default defineConfig({
protocols: ['http', 'https', 'mailto'],
},
],
[
rehypeComponents,
{
components: {
github: GithubCardComponent,
note: (properties: { 'has-directive-label'?: boolean }, children: any[]) => AdmonitionComponent(properties, children, 'note'),
tip: (properties: { 'has-directive-label'?: boolean }, children: any[]) => AdmonitionComponent(properties, children, 'tip'),
important: (properties: { 'has-directive-label'?: boolean }, children: any[]) => AdmonitionComponent(properties, children, 'important'),
caution: (properties: { 'has-directive-label'?: boolean }, children: any[]) => AdmonitionComponent(properties, children, 'caution'),
warning: (properties: { 'has-directive-label'?: boolean }, children: any[]) => AdmonitionComponent(properties, children, 'warning'),
},
},
],
[
rehypeAutolinkHeadings,
{