chore(scripts): 移除不必要的站点脚本

删除以下未使用的脚本:
- clear-vuepress-cache.mjs
- place-ragflow-guide.mjs
- verify-site.mjs
This commit is contained in:
祀梦
2026-03-29 13:22:45 +08:00
parent 5578a63c1d
commit 145f5b8971
3 changed files with 0 additions and 77 deletions

View File

@@ -1,12 +0,0 @@
import { rmSync, existsSync } from 'node:fs'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
const root = join(fileURLToPath(new URL('.', import.meta.url)), '..')
const cache = join(root, 'docs', '.vuepress', '.cache')
if (existsSync(cache)) {
rmSync(cache, { recursive: true, force: true })
console.log('cleared:', cache)
} else {
console.log('no cache dir:', cache)
}

View File

@@ -1,38 +0,0 @@
/**
* 将仓库根目录的 WINDOWS11_RAGFLOW_DEPLOYMENT_AND_MCP_GUIDE.md
* 合并 frontmatter 后写入 docs/notes/ai/ragflow-windows11-mcp.md模型 doc 集合)。
*/
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const root = path.resolve(__dirname, '..')
const src = path.join(root, 'WINDOWS11_RAGFLOW_DEPLOYMENT_AND_MCP_GUIDE.md')
const dest = path.join(root, 'docs', 'notes', 'ai', 'ragflow-windows11-mcp.md')
if (!fs.existsSync(src)) {
console.error('place-ragflow-guide: 找不到源文件', src)
console.error('请把 WINDOWS11_RAGFLOW_DEPLOYMENT_AND_MCP_GUIDE.md 放在仓库根目录后再运行。')
process.exit(1)
}
const stat = fs.statSync(src)
if (stat.size === 0) {
console.error('place-ragflow-guide: 源文件大小为 0请先写入正文再运行。')
process.exit(1)
}
const body = fs.readFileSync(src, 'utf8').replace(/^\uFEFF/, '')
const frontmatter = `---
title: Windows 11 本地部署 RAGFlow 与 Cursor MCP 完整记录
createTime: 2026/03/29 18:00:00
permalink: /article/windows11-ragflow-deployment-mcp/
sidebar: '/ai/'
---
`
fs.mkdirSync(path.dirname(dest), { recursive: true })
fs.writeFileSync(dest, frontmatter + body, 'utf8')
console.log('place-ragflow-guide: OK →', path.relative(root, dest))

View File

@@ -1,27 +0,0 @@
import { readFileSync, existsSync } from 'node:fs'
import { spawnSync } from 'node:child_process'
import { fileURLToPath } from 'node:url'
import { dirname, join } from 'node:path'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
const indexHtml = join(root, 'docs', '.vuepress', 'dist', 'index.html')
const build = spawnSync('npm', ['run', 'docs:build'], {
cwd: root,
shell: true,
stdio: 'inherit',
})
if (build.status !== 0) process.exit(build.status ?? 1)
if (!existsSync(indexHtml)) {
console.error('verify-site: dist/index.html missing after build')
process.exit(1)
}
const html = readFileSync(indexHtml, 'utf8')
if (!html.includes('hero-name') || !html.includes('仲夏夜之梦')) {
console.error('verify-site: home hero markers missing in dist/index.html (possible theme/render failure)')
process.exit(1)
}
console.log('verify-site: OK (home hero present in production build)')