Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: '' }],
Expand Down
13 changes: 13 additions & 0 deletions vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -68,6 +76,11 @@ export function createConfig(opts: CodeCoraConfig): UserConfig {
// NEW routing scheme: codecora.dev/<product>/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: '' }],
Expand Down