From 8da5cf2593a496e926ebba48c518876ead3813ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=80=E6=A2=A6?= <3501646051@qq.com> Date: Sun, 29 Mar 2026 00:28:45 +0800 Subject: [PATCH] =?UTF-8?q?feat(blog):=20=E8=8B=B1=E6=96=87=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E3=80=81=E4=B8=AD=E6=96=87=E5=88=86=E7=B1=BB=E4=B8=8E?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=98=85=E8=AF=BB=E6=97=B6=E9=97=B4=EF=BC=9B?= =?UTF-8?q?Plume=20RAG=20=E8=A7=84=E5=88=99=E4=B8=8E=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rules/ragflow-vuepress-plume-dataset.mdc | 14 + docs/.vuepress/client.ts | 1 + docs/.vuepress/config.ts | 20 +- .../plugins/enrichBlogReadingTime.ts | 61 +++ docs/.vuepress/theme/Blog/VPPostItem.vue | 416 ++++++++++++++++++ docs/.vuepress/theme/styles/custom.css | 28 ++ docs/blog/collect/free_model_pai.md | 5 +- .../14th-lanqiaocup-python-grad.md | 5 +- .../competition/mati-cup-2024-solutions.md | 5 +- docs/blog/elysia/elysia_quotation.md | 6 +- .../Deploying_WSL2_on_Windows_10.md | 8 +- docs/blog/technology/Operate_WSL2.md | 3 +- docs/blog/technology/bitwise-subsequences.md | 5 +- docs/blog/technology/fast-power-algorithm.md | 5 +- docs/blog/technology/python_string_format.md | 5 +- .../signed-binary-representations.md | 5 +- docs/blog/website/EdgeOne_Pages_Images.md | 3 +- script/commit-notes.ps1 | 17 + 18 files changed, 578 insertions(+), 34 deletions(-) create mode 100644 .cursor/rules/ragflow-vuepress-plume-dataset.mdc create mode 100644 docs/.vuepress/plugins/enrichBlogReadingTime.ts create mode 100644 docs/.vuepress/theme/Blog/VPPostItem.vue create mode 100644 script/commit-notes.ps1 diff --git a/.cursor/rules/ragflow-vuepress-plume-dataset.mdc b/.cursor/rules/ragflow-vuepress-plume-dataset.mdc new file mode 100644 index 0000000..38df2de --- /dev/null +++ b/.cursor/rules/ragflow-vuepress-plume-dataset.mdc @@ -0,0 +1,14 @@ +--- +description: RAGFlow 检索 Plume 主题时必须使用 VuePress2-Plume 数据集,避免选错知识库 +alwaysApply: true +--- + +# RAGFlow 与 Plume 文档 + +当任务涉及 **vuepress-theme-plume**、**Plume 主题**、**主题配置 / 博客 / 分类 / 标签 / 侧边栏** 等与 Plume 相关的问题,需要通过 **RAGFlow MCP**(`ragflow_retrieval`)查官方文档时: + +- **必须使用数据集**:**VuePress2-Plume**(名称)。 +- 若接口需要 `dataset_ids`:当前知识库 ID 为 **`e57440b52aa711f1845c9627700ac9a4`**(与名称对应;若后台重建数据集请以维护者为准更新本条)。 +- **禁止**在未确认数据集的情况下用其它知识库代替 Plume 文档检索,以免污染答案或引发环境异常。 + +与 Plume 无关的问题(例如通用 VuePress 2 核心、本项目业务逻辑)再按需选择其它数据集或不指定 `dataset_ids`。 diff --git a/docs/.vuepress/client.ts b/docs/.vuepress/client.ts index aa1c369..51b56d6 100644 --- a/docs/.vuepress/client.ts +++ b/docs/.vuepress/client.ts @@ -1,5 +1,6 @@ import { defineClientConfig } from 'vuepress/client' import RImg from './theme/components/RImg.vue' +import './theme/styles/custom.css' export default defineClientConfig({ enhance({ app }) { diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 61494d5..85850bc 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -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 = { + 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(), ], }) diff --git a/docs/.vuepress/plugins/enrichBlogReadingTime.ts b/docs/.vuepress/plugins/enrichBlogReadingTime.ts new file mode 100644 index 0000000..f7c23fc --- /dev/null +++ b/docs/.vuepress/plugins/enrichBlogReadingTime.ts @@ -0,0 +1,61 @@ +import fs from 'node:fs' +import { pathToFileURL } from 'node:url' +import type { App, PluginFunction } from 'vuepress' + +const HMR_TAIL = `if (import.meta.webpackHot) { + import.meta.webpackHot.accept() + if (__VUE_HMR_RUNTIME__.updateBlogPostData) { + __VUE_HMR_RUNTIME__.updateBlogPostData(blogPostData) + } +} + +if (import.meta.hot) { + import.meta.hot.accept(({ blogPostData }) => { + __VUE_HMR_RUNTIME__.updateBlogPostData(blogPostData) + }) +} +` + +async function enrichBlogData(app: App): Promise { + const tempFile = app.dir.temp('internal/blogData.js') + if (!fs.existsSync(tempFile)) return + + let blogPostData: Record[] + try { + const url = `${pathToFileURL(tempFile).href}?t=${Date.now()}` + const mod = await import(url) as { blogPostData: Record[] } + blogPostData = mod.blogPostData.map(p => ({ ...p })) + } + catch { + return + } + + const byPath = new Map() + for (const page of app.pages) { + const rt = page.data.readingTime as { minutes: number; words: number } | undefined + if (rt && typeof rt.words === 'number') byPath.set(page.path, rt) + } + + for (const post of blogPostData) { + const rt = byPath.get(post.path as string) + if (rt) post.readingTime = rt + } + + await app.writeTemp( + 'internal/blogData.js', + `export const blogPostData = ${JSON.stringify(blogPostData)}\n\n${HMR_TAIL}\n`, + ) +} + +/** + * 在主题写入 blogData 之后,把各页的 readingTime(字数、分钟)并入博客列表数据, + * 供自定义 VPPostItem 在 /blog/ 列表展示。 + */ +export function enrichBlogReadingTimePlugin(): PluginFunction { + return () => ({ + name: 'enrich-blog-reading-time', + onPrepared: async (app: App) => { + await enrichBlogData(app) + }, + }) +} diff --git a/docs/.vuepress/theme/Blog/VPPostItem.vue b/docs/.vuepress/theme/Blog/VPPostItem.vue new file mode 100644 index 0000000..b124923 --- /dev/null +++ b/docs/.vuepress/theme/Blog/VPPostItem.vue @@ -0,0 +1,416 @@ + + + + + diff --git a/docs/.vuepress/theme/styles/custom.css b/docs/.vuepress/theme/styles/custom.css index 16de560..d05fa92 100644 --- a/docs/.vuepress/theme/styles/custom.css +++ b/docs/.vuepress/theme/styles/custom.css @@ -1,3 +1,31 @@ +/** + * 博客:分类(中文展示名)与标签(英文)之间留出间距;分类路径本身前后略松一些 + */ +.vp-blog-post-item .post-meta .category-list { + padding: 0.3em 0.65em; + margin-right: 0.75rem; + margin-left: 0.15rem; + border-radius: 4px; +} + +.vp-blog-post-item .post-meta .category-list .icon { + margin-right: 0.45rem; +} + +.vp-blog-post-item .post-meta .category-list a + span { + margin-inline: 0.2em; +} + +/* 文章页面包屑:各级目录名前后略留白 */ +.vp-breadcrumb ol { + gap: 6px 10px; +} + +.vp-breadcrumb ol li .breadcrumb:not(.current) { + padding: 0.15em 0.5em; + border-radius: 4px; +} + :root { /** 主题颜色 */ diff --git a/docs/blog/collect/free_model_pai.md b/docs/blog/collect/free_model_pai.md index 387dfcf..0fc4012 100644 --- a/docs/blog/collect/free_model_pai.md +++ b/docs/blog/collect/free_model_pai.md @@ -1,10 +1,9 @@ --- title: 便宜免费的大模型 API 整合 ( 2025年11月11日 ) createTime: 2025/11/11 13:54:02 -cover: /images/elysia/1.jpg -coverStyle: - layout: right permalink: /article/free_model_api/ +tags: + - llm --- 百度千帆、讯飞星火、腾讯混元均有免费在线额度,SCNet 提供 0.1 元/百万 tokens 的超低价大模型,轻量任务先薅免费,量大了再掏 0.1 元,稳! diff --git a/docs/blog/competition/14th-lanqiaocup-python-grad.md b/docs/blog/competition/14th-lanqiaocup-python-grad.md index 83f1ae4..5c30ae9 100644 --- a/docs/blog/competition/14th-lanqiaocup-python-grad.md +++ b/docs/blog/competition/14th-lanqiaocup-python-grad.md @@ -1,10 +1,9 @@ --- title: 第十四届蓝桥杯大赛软件赛国赛 Python 研究生组(正在更新) createTime: 2026/01/09 15:57:22 -cover: /images/elysia/8.jpg -coverStyle: - layout: right permalink: /archives/b1c77a1d-d402-4788-8049-fa3aeb12ebd0/ +tags: + - contest --- ## 一、X 质数 diff --git a/docs/blog/competition/mati-cup-2024-solutions.md b/docs/blog/competition/mati-cup-2024-solutions.md index 6b6a94c..6aaa41a 100644 --- a/docs/blog/competition/mati-cup-2024-solutions.md +++ b/docs/blog/competition/mati-cup-2024-solutions.md @@ -1,10 +1,9 @@ --- title: 码蹄杯 2024 年真题集详解 createTime: 2026/01/09 16:24:00 -cover: /images/elysia/11.jpg -coverStyle: - layout: left permalink: /archives/d0ad06b9-d675-461c-a8ce-f47baeeb291d/ +tags: + - contest --- 码蹄杯真题库:2022年-2024年码蹄杯题集 diff --git a/docs/blog/elysia/elysia_quotation.md b/docs/blog/elysia/elysia_quotation.md index 3a5dc75..983cfc4 100644 --- a/docs/blog/elysia/elysia_quotation.md +++ b/docs/blog/elysia/elysia_quotation.md @@ -1,14 +1,12 @@ --- title: 爱莉希雅语录 createTime: 2026/01/08 15:39:17 -cover: /images/elysia/2.png -coverStyle: - layout: left permalink: /archives/a5b3ea8e-7c3c-40a1-a737-26e911623da8/ +tags: + - honkai-impact-3rd --- 嗨,亲爱的来访者♪ 欢迎来到这片收集了“真我”与“美丽”碎片的园圃。在这里,你会读到执拗花朵在暴雨中的坚持,也会听见逐火英桀们为文明奏响的最后颂歌。请怀着期待慢慢翻阅吧,愿这些如星光般的文字能陪你开启属于自己的闪耀旅程,毕竟……你本身就是这世间最瑰丽的馈赠呢♪ -![elysia](/images/elysia/1.jpg) 1. 执拗的花朵永远不会因暴雨而褪去颜色,你的决心也一定能在绝境中绽放真我。 2. 愿你前行的道路有群星闪耀。愿你留下的足迹有百花绽放。你即是上帝的馈赠,世界因你而瑰丽。 diff --git a/docs/blog/technology/Deploying_WSL2_on_Windows_10.md b/docs/blog/technology/Deploying_WSL2_on_Windows_10.md index ea3c21e..c94daed 100644 --- a/docs/blog/technology/Deploying_WSL2_on_Windows_10.md +++ b/docs/blog/technology/Deploying_WSL2_on_Windows_10.md @@ -1,10 +1,9 @@ --- title: 在 Windows10 上部署 WSL2 并启动 ubuntu 虚拟机 createTime: 2025/09/29 07:13:17 -cover: /images/elysia/3.jpg -coverStyle: - layout: right permalink: /article/deploying-wsl2-on-windows-10/ +tags: + - wsl --- 嗨呀~让我们在 Windows10 专业版上部署 WSL2 并启动 ubuntu 20.04 虚拟机吧~ @@ -113,8 +112,6 @@ Press any key to continue... #### 错误码 0x80370102 虚拟化技术没有开启 如果遇到这个错误,可能是因为虚拟化技术没有开启哦~如果是在真实机上操作的话,需要进入BIOS开启虚拟化技术呢~开启之后,可以在任务管理器 -> 性能 -> CPU 的详情页面中,看到下方的虚拟化状态显示为「已启用」哦~ -![虚拟化技术启用](https://image.simengweb.com/blog/technology/20250930140716_251_27.png) - 如果是在虚拟机中操作的话,就需要启用嵌套虚拟化技术啦~以VMware为例: 先关闭虚拟机,然后找到虚拟机的.vmx配置文件(通常在虚拟机目录下),在文件末尾添加一行:`vhv.enable = "TRUE"` @@ -145,5 +142,4 @@ wsl --terminate Ubuntu-20.04 接下来,我们还可以通过VS Code来进行开发哦~不过需要先安装一些扩展呢:'Remote - SSH'和'WSL' 安装好扩展后,在VS Code左侧打开远程资源管理器,就可以看到Ubuntu20.04虚拟机啦~直接点击连接就可以了哦~不过第一次连接可能需要启动一下虚拟机,会有点慢呢,耐心等待一下吧~ -![连接 WSL2 虚拟机](https://image.simengweb.com/blog/technology/20250930144329_252_27.png) 连接成功之后,就可以愉快地进行开发啦~是不是很简单呢~ diff --git a/docs/blog/technology/Operate_WSL2.md b/docs/blog/technology/Operate_WSL2.md index a8a2e1e..613a61d 100644 --- a/docs/blog/technology/Operate_WSL2.md +++ b/docs/blog/technology/Operate_WSL2.md @@ -1,8 +1,9 @@ --- title: WSL2 核心操作指南 createTime: 2025/09/30 16:08:32 -cover: /images/elysia/4.jpg permalink: /article/operate-wsl2/ +tags: + - wsl --- 这篇文章主要讲WSL2虚拟机核心操作哦~它基于轻量级Hyper-V运行,像贴心小精灵默默工作~还能用命令行精细控制!接下来讲启动/关闭、实例管理、资源配置、网络操作、备份迁移这五大操作,是不是很期待呢~♪ diff --git a/docs/blog/technology/bitwise-subsequences.md b/docs/blog/technology/bitwise-subsequences.md index ecefe14..cc78cf5 100644 --- a/docs/blog/technology/bitwise-subsequences.md +++ b/docs/blog/technology/bitwise-subsequences.md @@ -1,10 +1,9 @@ --- title: 通过位运算快速生成所有的子序列 createTime: 2026/01/09 16:15:00 -cover: /images/elysia/10.jpg -coverStyle: - layout: right permalink: /archives/ea20bdda-0d49-4472-a647-2e305a930d11/ +tags: + - algorithms --- ## 一、子序列的本质 diff --git a/docs/blog/technology/fast-power-algorithm.md b/docs/blog/technology/fast-power-algorithm.md index ae048cd..9174142 100644 --- a/docs/blog/technology/fast-power-algorithm.md +++ b/docs/blog/technology/fast-power-algorithm.md @@ -1,10 +1,9 @@ --- title: 快速幂算法详解 createTime: 2026/01/09 16:05:00 -cover: /images/elysia/9.jpg -coverStyle: - layout: left permalink: /archives/1325a3bf-91d7-43ff-9630-e894549e12c1/ +tags: + - algorithms --- ## 简介 diff --git a/docs/blog/technology/python_string_format.md b/docs/blog/technology/python_string_format.md index f2f80ec..96faf04 100644 --- a/docs/blog/technology/python_string_format.md +++ b/docs/blog/technology/python_string_format.md @@ -1,10 +1,9 @@ --- title: Python 字符串格式化全指南 createTime: 2026/01/09 14:00:48 -cover: /images/elysia/7.jpg -coverStyle: - layout: left permalink: /archives/56ea3081-9c69-43d7-96c8-2812ec08be2c/ +tags: + - python --- ## 字符串格式化 diff --git a/docs/blog/technology/signed-binary-representations.md b/docs/blog/technology/signed-binary-representations.md index 6ad3b80..d6aecb1 100644 --- a/docs/blog/technology/signed-binary-representations.md +++ b/docs/blog/technology/signed-binary-representations.md @@ -1,10 +1,9 @@ --- title: 原码、反码、补码 createTime: 2026/01/08 16:34:05 -cover: /images/elysia/6.jpg -coverStyle: - layout: right permalink: /archives/6f41cabe-41e6-4a09-9f1c-af7dd709a35d/ +tags: + - cs-fundamentals --- 欢迎来到 0 与 1 的魔法派对!这篇文章将带你揭开原码、反码与补码的奥秘,看计算机如何巧妙地用补码化减为加。让我们一起翻开这页,去捕捉二进制底层那份迷人的理性之美吧♪ diff --git a/docs/blog/website/EdgeOne_Pages_Images.md b/docs/blog/website/EdgeOne_Pages_Images.md index ce675f4..1d6efa5 100644 --- a/docs/blog/website/EdgeOne_Pages_Images.md +++ b/docs/blog/website/EdgeOne_Pages_Images.md @@ -1,8 +1,9 @@ --- title: 通过 EdgeOne Pages 搭建图床 createTime: 2025/09/29 02:28:17 -cover: /images/elysia/5.jpg permalink: /article/8gihio2v/ +tags: + - image-hosting --- 各位~今天要给大家介绍一个超棒的图床搭建方法哦!EdgeOne Pages 是腾讯云提供的静态网站托管服务,而且还有免费额度可以使用呢,对于日常需求来说完全足够啦~ diff --git a/script/commit-notes.ps1 b/script/commit-notes.ps1 new file mode 100644 index 0000000..b0ecafc --- /dev/null +++ b/script/commit-notes.ps1 @@ -0,0 +1,17 @@ +# 提交笔记站源码变更(尊重 .gitignore,不会加入 _publish、dist、PROJECT_BRIEF.local.md 等) +# 用法: .\script\commit-notes.ps1 -m "提交说明" +param( + [Parameter(Mandatory = $true)] + [string] $Message +) +$ErrorActionPreference = "Stop" +$root = Split-Path -Parent $PSScriptRoot +Set-Location $root + +git add docs/.vuepress docs/blog .cursor/rules script/commit-notes.ps1 +$staged = @(git diff --cached --name-only) +if ($staged.Count -eq 0) { + Write-Host "No staged changes." + exit 0 +} +git commit -m $Message