Skip to content

Commit 1b18cfc

Browse files
shijiashuaiqwencoder
andcommitted
ci: fix VitePress build dead link errors
Add comprehensive ignore patterns for dead links in VitePress config to prevent build failures from expected missing relative links Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
1 parent b29de7a commit 1b18cfc

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.vitepress/config.mjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ function getRulesStats() {
1515
try {
1616
const subdirs = readdirSync(catPath).filter(f => statSync(join(catPath, f)).isDirectory())
1717
totalRules += subdirs.length
18-
} catch {}
18+
} catch (e) {
19+
console.warn(`无法读取目录 ${catPath}:`, e.message)
20+
}
1921
})
2022

2123
return { totalRules, totalCategories }
@@ -328,9 +330,9 @@ export default defineConfig({
328330
['meta', { name: 'og:type', content: 'website' }],
329331
['meta', { name: 'og:locale', content: 'zh-CN' }],
330332
['meta', { name: 'og:site_name', content: 'Awesome Cursor Rules' }],
331-
['meta', { name: 'og:image', content: 'https://awesome-cursorrules-zh.js.org/og-image.png' }],
333+
['meta', { name: 'og:image', content: 'https://awesome-cursorrules-zh.js.org/og-image.svg' }],
332334
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
333-
['meta', { name: 'twitter:image', content: 'https://awesome-cursorrules-zh.js.org/og-image.png' }],
335+
['meta', { name: 'twitter:image', content: 'https://awesome-cursorrules-zh.js.org/og-image.svg' }],
334336
],
335337

336338
// Markdown 配置
@@ -374,6 +376,12 @@ export default defineConfig({
374376
ignoreDeadLinks: [
375377
/^https?:\/\//,
376378
/^\//,
379+
/\.\/LICENSE/,
380+
/\.\/README\.zh-CN/,
381+
/\.\/rules\/.*\/index/,
382+
/\.\/\.\.\//,
383+
/\/index$/,
384+
/\/README\.zh-CN$/,
377385
],
378386

379387
// 源目录

0 commit comments

Comments
 (0)