-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support nuxt.schema for visual edition in studio (#723)
Co-authored-by: Pooya Parsa <[email protected]>
- Loading branch information
Showing
5 changed files
with
597 additions
and
527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,7 @@ | ||
export default defineAppConfig({ | ||
docus: { | ||
/** | ||
* Website title. | ||
*/ | ||
title: 'Docus', | ||
/** | ||
* Website description. | ||
*/ | ||
description: 'The best place to start your documentation.', | ||
/** | ||
* Cover image. | ||
*/ | ||
image: 'https://user-images.githubusercontent.com/904724/185365452-87b7ca7b-6030-4813-a2db-5e65c785bf88.png', | ||
/** | ||
* Social links. | ||
* | ||
* Will be used in Social Icons component, in AppHeader and AppFooter. | ||
*/ | ||
socials: { | ||
// twitter: '@nuxt_js', | ||
// github: 'https://github.com/nuxt-themes/docus', | ||
// facebook: '', | ||
// instagram: '', | ||
// youtube: '', | ||
// medium: '' | ||
}, | ||
aside: { | ||
/** | ||
* The level to which the navigation should be scaled. | ||
* | ||
* Use 0 to disable all nesting. | ||
* Use 1 and more to display nested navigation in header and aside navigation. | ||
*/ | ||
level: 0, | ||
/** | ||
* Specify if default collapsibles state globally for aside navigation. | ||
*/ | ||
collapsed: false, | ||
/** | ||
* Paths to be excluded from aside navigation. | ||
*/ | ||
exclude: [] | ||
}, | ||
header: { | ||
/** | ||
* Title to be displayed in header. | ||
*/ | ||
title: '', | ||
/** | ||
* Logo configuration | ||
* | ||
* Boolean to disable or use the `Logo.vue` component. | ||
* String to be used as a name of a component. | ||
*/ | ||
logo: false, | ||
/** | ||
* Toggle links icons in the header. | ||
*/ | ||
showLinkIcon: false, | ||
/** | ||
* Paths to be excluded from header links. | ||
*/ | ||
exclude: [] | ||
}, | ||
footer: { | ||
/** | ||
* Credits configuration | ||
* | ||
* Object configuring the credits part of footer. | ||
* Boolean to disable. | ||
*/ | ||
credits: { | ||
icon: 'IconDocus', | ||
text: 'Powered by Docus', | ||
href: 'https://docus.dev' | ||
}, | ||
/** | ||
* Icons to be added to Social Icons in footer. | ||
*/ | ||
iconLinks: [] | ||
} | ||
} | ||
/** | ||
* Default are defined in nuxt.schema.ts for best typing and Studio integration | ||
* This file can be used to leverage HMR while developping this theme | ||
* Note that this file is not published to npm | ||
*/ | ||
}) | ||
|
||
interface IconLink { | ||
href: string | ||
icon: string | ||
label?: string | ||
} | ||
|
||
declare module '@nuxt/schema' { | ||
interface AppConfigInput { | ||
docus?: { | ||
title?: string | ||
description?: string | ||
image?: string | ||
socials?: { | ||
twitter?: string | ||
github?: string | ||
facebook?: string | ||
instagram?: string | ||
youtube?: string | ||
medium?: string | ||
}, | ||
aside?: { | ||
level: number | ||
exclude?: string[] | ||
collapsed?: boolean | ||
}, | ||
header?: { | ||
title?: string, | ||
logo?: boolean | ||
showLinkIcon?: boolean | ||
exclude?: string[] | ||
}, | ||
footer?: { | ||
credits?: boolean | { | ||
icon: string | ||
text: string | ||
href: string | ||
} | ||
iconLinks?: IconLink[] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
export default defineNuxtConfigSchema({ | ||
appConfig: { | ||
docus: { | ||
/** | ||
* Website title, used as header default title and meta title. | ||
*/ | ||
title: 'Docus', | ||
/** | ||
* Website description, used for meta description. | ||
*/ | ||
description: 'The best place to start your documentation.', | ||
/** | ||
* Cover image. | ||
* | ||
* @example '/cover.jpg' | ||
*/ | ||
image: | ||
'https://user-images.githubusercontent.com/904724/185365452-87b7ca7b-6030-4813-a2db-5e65c785bf88.png', | ||
/** | ||
* Social links. | ||
* | ||
* Will be used in Social Icons component, in AppHeader and AppFooter. | ||
*/ | ||
socials: { | ||
/** | ||
* Twitter social handle | ||
* @example 'nuxt_js' | ||
*/ | ||
twitter: '', | ||
/** | ||
* GitHub org or repository | ||
* @example 'nuxt/framework' | ||
*/ | ||
github: '', | ||
facebook: '', | ||
instagram: '', | ||
youtube: '', | ||
medium: '' | ||
}, | ||
aside: { | ||
/** | ||
* The level to which the navigation should be scaled. | ||
* | ||
* Use 0 to disable all nesting. | ||
* Use 1 and more to display nested navigation in header and aside navigation. | ||
*/ | ||
level: 0, | ||
/** | ||
* Specify if default collapsibles state globally for aside navigation. | ||
*/ | ||
collapsed: false, | ||
/** | ||
* Paths to be excluded from aside navigation. | ||
* | ||
* @type {string[]} | ||
*/ | ||
exclude: [] | ||
}, | ||
header: { | ||
/** | ||
* Title to be displayed in header or as aria-label if logo is defined | ||
* | ||
* Default to docus.title | ||
*/ | ||
title: '', | ||
/** | ||
* Logo configuration | ||
* | ||
* Boolean to disable or use the `Logo.vue` component. | ||
* | ||
* String to be used as a name of a component. | ||
* | ||
* @example 'MyLogo' | ||
*/ | ||
logo: false, | ||
/** | ||
* Toggle links icons in the header. | ||
*/ | ||
showLinkIcon: false, | ||
/** | ||
* Paths to be excluded from header links. | ||
* | ||
* @type {string[]} | ||
*/ | ||
exclude: [] | ||
}, | ||
footer: { | ||
/** | ||
* Credits configuration | ||
* | ||
* Object configuring the credits part of footer. | ||
* | ||
* @type {false|object} | ||
*/ | ||
credits: { | ||
/** | ||
* Icon to show on credits | ||
* @formtype Icon | ||
*/ | ||
icon: 'IconDocus', | ||
text: 'Powered by Docus', | ||
href: 'https://docus.dev' | ||
}, | ||
/** | ||
* Icons to be added to Social Icons in footer. | ||
*/ | ||
iconLinks: { | ||
$schema: { | ||
type: 'array', | ||
items: { | ||
type: 'object', | ||
required: ['icon', 'href'], | ||
properties: { | ||
icon: { type: 'string', description: 'Icon name' }, | ||
href: { | ||
type: 'string', | ||
description: 'Link when clicking on the icon' | ||
}, | ||
label: { type: 'string', description: 'Label of the icon' } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
db0829a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docus – ./
www.docus.dev
docus-git-dev-nuxtlabs.vercel.app
docus-nuxtlabs.vercel.app
docus-theme.vercel.app
docus.dev