From 1b8f9fa41a9005ede7ac420a7884730d5a485ca4 Mon Sep 17 00:00:00 2001 From: ajianaz Date: Fri, 17 Jul 2026 07:56:05 +0700 Subject: [PATCH] fix: forward ignoreDeadLinks, srcExclude, lastUpdated, head from opts --- vitepress/config.mjs | 6 ++++++ vitepress/config.ts | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/vitepress/config.mjs b/vitepress/config.mjs index 342991f..4d84c09 100644 --- a/vitepress/config.mjs +++ b/vitepress/config.mjs @@ -28,6 +28,12 @@ export function createConfig(opts) { lang: 'en', cleanUrls: true, base: `/${opts.product}/docs/`, + + // Forward optional user config + ...(opts.ignoreDeadLinks !== undefined && { ignoreDeadLinks: opts.ignoreDeadLinks }), + ...(opts.srcExclude && { srcExclude: opts.srcExclude }), + ...(opts.lastUpdated !== undefined && { lastUpdated: opts.lastUpdated }), + head: [ ['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }], ['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }], diff --git a/vitepress/config.ts b/vitepress/config.ts index 209533c..c88593e 100644 --- a/vitepress/config.ts +++ b/vitepress/config.ts @@ -53,6 +53,14 @@ export interface CodeCoraConfig { nav?: Array<{ text: string; link: string }> /** Disable local search if a product wants Algolia later. */ search?: false + /** Extra VitePress head tags (merged after theme defaults). */ + head?: UserConfig['head'] + /** VitePress ignoreDeadLinks (boolean or RegExp[]). */ + ignoreDeadLinks?: UserConfig['ignoreDeadLinks'] + /** VitePress srcExclude patterns. */ + srcExclude?: UserConfig['srcExclude'] + /** Show last-updated timestamp. */ + lastUpdated?: boolean } export function createConfig(opts: CodeCoraConfig): UserConfig { @@ -68,6 +76,11 @@ export function createConfig(opts: CodeCoraConfig): UserConfig { // NEW routing scheme: codecora.dev//docs/ base: `/${opts.product}/docs/`, + // Forward optional user config + ...(opts.ignoreDeadLinks !== undefined && { ignoreDeadLinks: opts.ignoreDeadLinks }), + ...(opts.srcExclude && { srcExclude: opts.srcExclude }), + ...(opts.lastUpdated !== undefined && { lastUpdated: opts.lastUpdated }), + head: [ ['link', { rel: 'preconnect', href: 'https://fonts.googleapis.com' }], ['link', { rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' }],