Files
SiMengWebSite_Notes/docs/.vuepress/config.ts
祀梦 f50d8ef8c2 chore: 升级 VuePress/Plume 并迁移至 collections 配置
- 将 vuepress 升至 2.0.0-rc.26、vuepress-theme-plume 升至 1.0.0-rc.192

- 用 defineCollections 替代已废弃的 blog + notes,新增 collections.ts 并删除 notes.ts

- 通过 package overrides 将 @vuepress/helper 固定为 rc.123,避免 dev 下 encodeSVG 缺失导致首页白屏

- 新增 .npmrc(legacy-peer-deps)以兼容当前 peer 依赖解析

未包含 docs/.vuepress/dist 等构建产物。

Made-with: Cursor
2026-03-29 10:01:40 +08:00

102 lines
2.5 KiB
TypeScript

import { defineUserConfig } from 'vuepress'
import { plumeTheme } from 'vuepress-theme-plume'
import { viteBundler } from '@vuepress/bundler-vite'
import { commentPlugin } from '@vuepress/plugin-comment'
import { umamiAnalyticsPlugin } from '@vuepress/plugin-umami-analytics'
import { enrichBlogReadingTimePlugin } from './plugins/enrichBlogReadingTime'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
export default defineUserConfig({
base: '/',
lang: 'zh-CN',
title: '仲夏夜之梦',
description: '爱与回忆的小世界,记录生活中的每一份温暖与感动',
head: [
['link', { rel: 'icon', type: 'image/png', href: 'https://theme-plume.vuejs.press/favicon-32x32.png' }],
],
bundler: viteBundler({
viteOptions: {
resolve: {
alias: {
'@theme/Blog/VPPostItem.vue': path.resolve(__dirname, './theme/Blog/VPPostItem.vue'),
},
},
},
}),
shouldPrefetch: false,
theme: plumeTheme({
/* 站点域名,启动 SEO 优化 */
hostname: 'https://www.simengweb.com',
/* 启用数学公式支持和Mermaid图表 */
markdown: {
math: {
type: 'katex',
},
mermaid: true,
demo: true,
},
/**
* 编译缓存,加快编译速度
*/
cache: 'filesystem',
/* 本地搜索, 默认启用 */
search: { provider: 'local' },
footer: {
message: '愿每一份温柔都被世界珍藏 ✨',
copyright: '<a href="https://beian.miit.gov.cn/" target="_blank" aria-label="gongan filing address">沪ICP备2023010022号-1</a>©2025祀梦的个人博客'
},
/**
* 文章贡献者配置
*/
contributors: {
mode: 'inline',
info: [
{
username: 'si-meng-spec',
name: 'si-meng-spec',
alias: ['si-meng-spec'],
}
]
},
/**
* Git插件配置
* 设置为true以在开发环境也启用
*/
plugins: {
git: true
},
codeHighlighter: {
lineNumbers: true,
}
}),
plugins: [
commentPlugin({
provider: 'Waline',
serverURL: 'https://vercel.simengweb.com',
meta: ['nick'],
requiredMeta: ['nick']
}),
umamiAnalyticsPlugin({
id: '2114ab32-5543-4be1-b5e8-c4f2c9269d0d',
link: 'https://umami.simengweb.com/script.js',
domains: ['www.simengweb.com'],
cache: true
}),
enrichBlogReadingTimePlugin(),
],
})