mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
docs: add @nuxt/ui-pro source (#2775)
This commit is contained in:
@@ -1,24 +1,45 @@
|
||||
import { defineCollection, z } from '@nuxt/content'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
const schema = z.object({
|
||||
framework: z.string().optional(),
|
||||
module: z.string().optional(),
|
||||
navigation: z.object({
|
||||
title: z.string().optional()
|
||||
}),
|
||||
links: z.array(z.object({
|
||||
label: z.string(),
|
||||
icon: z.string(),
|
||||
avatar: z.object({
|
||||
src: z.string(),
|
||||
alt: z.string()
|
||||
}).optional(),
|
||||
to: z.string(),
|
||||
target: z.string().optional()
|
||||
}))
|
||||
})
|
||||
|
||||
const pro = process.env.NUXT_UI_PRO_PATH
|
||||
? {
|
||||
cwd: resolve(__dirname, process.env.NUXT_UI_PRO_PATH, 'docs'),
|
||||
include: 'content/**',
|
||||
prefix: '/'
|
||||
}
|
||||
: process.env.NUXT_GITHUB_TOKEN
|
||||
? {
|
||||
repository: 'https://github.com/nuxt/ui-pro/tree/v3',
|
||||
include: 'docs/content/**',
|
||||
prefix: '/',
|
||||
authToken: process.env.NUXT_GITHUB_TOKEN
|
||||
}
|
||||
: undefined
|
||||
|
||||
export const collections = {
|
||||
content: defineCollection({
|
||||
type: 'page',
|
||||
source: '**/*',
|
||||
schema: z.object({
|
||||
framework: z.string().optional(),
|
||||
navigation: z.object({
|
||||
title: z.string().optional()
|
||||
}),
|
||||
links: z.array(z.object({
|
||||
label: z.string(),
|
||||
icon: z.string(),
|
||||
avatar: z.object({
|
||||
src: z.string(),
|
||||
alt: z.string()
|
||||
}).optional(),
|
||||
to: z.string(),
|
||||
target: z.string().optional()
|
||||
}))
|
||||
})
|
||||
source: [{
|
||||
include: '**/*'
|
||||
}, pro!],
|
||||
schema
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user