feat(blog): 英文标签、中文分类与列表阅读时间;Plume RAG 规则与提交脚本

This commit is contained in:
祀梦
2026-03-29 00:28:45 +08:00
parent 05349b2628
commit 8da5cf2593
18 changed files with 578 additions and 34 deletions

View File

@@ -3,12 +3,23 @@ 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)
/** 博客目录名 → 中文分类展示Plume 从路径自动生成分类,此处仅改展示名) */
const BLOG_CATEGORY_LABEL_ZH: Record<string, string> = {
blog: '博客',
competition: '竞赛',
technology: '技术',
website: '网站',
elysia: '爱莉希雅',
collect: '合集',
}
export default defineUserConfig({
base: '/',
lang: 'zh-CN',
@@ -23,6 +34,7 @@ export default defineUserConfig({
viteOptions: {
resolve: {
alias: {
'@theme/Blog/VPPostItem.vue': path.resolve(__dirname, './theme/Blog/VPPostItem.vue'),
},
},
},
@@ -62,7 +74,12 @@ export default defineUserConfig({
layout: 'left',
// width: 300,
compact: true
}
},
categoriesTransform: (categories) =>
categories.map((c) => ({
...c,
name: BLOG_CATEGORY_LABEL_ZH[c.name] ?? c.name,
})),
},
/**
@@ -106,5 +123,6 @@ export default defineUserConfig({
domains: ['www.simengweb.com'],
cache: true
}),
enrichBlogReadingTimePlugin(),
],
})