feat(blog): 英文标签、中文分类与列表阅读时间;Plume RAG 规则与提交脚本
This commit is contained in:
@@ -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(),
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user