Skip to content

Commit

Permalink
chore(schema): update schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Jan 25, 2023
1 parent ae3d4df commit fd72ee2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
12 changes: 5 additions & 7 deletions components/docs/DocsAsideTree.vue
Expand Up @@ -27,19 +27,19 @@ const collapsedMap = useState(`docus-docs-aside-collapse-map-${props.parent?._pa
if (props.level === 0) {
return {}
}
return props.links
return (props.links as any [])
.filter(link => !!link.children)
.reduce((map, link) => {
map[link._path] = true
return map
}, {})
})
const isActive = (link) => {
const isActive = (link: any) => {
return route.path === link._path
}
const isCollapsed = (link) => {
const isCollapsed = (link: any) => {
if (link.children) {
// Directory has been toggled manually, use its state
if (typeof collapsedMap.value[link._path] !== 'undefined') {
Expand All @@ -49,15 +49,13 @@ const isCollapsed = (link) => {
// Return value grabbed from the link
if (link?.collapsed) { return link?.collapsed }
if (docus.value.aside?.collapsed) { return docus.value.aside?.collapsed }
if (docus?.value?.aside?.collapsed) { return docus.value.aside?.collapsed }
}
return false
}
const toggleCollapse = (link) => {
collapsedMap.value[link._path] = !isCollapsed(link)
}
const toggleCollapse = (link: any) => (collapsedMap.value[link._path] = !isCollapsed(link))
const hasNesting = computed(() => props.links.some((link: any) => link.children))
</script>
Expand Down
42 changes: 21 additions & 21 deletions nuxt.schema.ts
Expand Up @@ -3,79 +3,79 @@ export default defineNuxtConfigSchema({
/**
* Docus theme configuration.
*
* @studio-icon material-symbols:docs
* @studioIcon material-symbols:docs
*/
docus: {
/**
* Website title, used as header default title and meta title.
*
* @studio-icon material-symbols:title
* @studioIcon material-symbols:title
*/
title: 'Docus',
/**
* Website description, used for meta description.
*
* @studio-icon material-symbols:description
* @studioIcon material-symbols:description
*/
description: 'The best place to start your documentation.',
/**
* Cover image.
*
* @example '/cover.jpg'
*
* @studio-icon dashicons:cover-image
* @studio-input file
* @studioIcon dashicons:cover-image
* @studioInput file
*/
image: 'https://user-images.githubusercontent.com/904724/185365452-87b7ca7b-6030-4813-a2db-5e65c785bf88.png',
/**
* Social links
*
* Will be used in AppSocialIcons component.
*
* @studio-icon material-symbols:share-outline
* @studioIcon material-symbols:share-outline
*/
socials: {
/**
* Twitter social handle
* @example 'nuxt_js'
* @studio-icon simple-icons:twitter
* @studioIcon simple-icons:twitter
*/
twitter: '',
/**
* GitHub org or repository
* @example 'nuxt/framework'
* @studio-icon simple-icons:github
* @studioIcon simple-icons:github
*/
github: '',
/**
* Facebook page url
* @example https://www.facebook.com/groups/nuxtjs
* @studio-icon simple-icons:facebook
* @studioIcon simple-icons:facebook
*/
facebook: '',
/**
* Instagram page url
* @example https://www.instagram.com/wearenuxt
* @studio-icon simple-icons:instagram
* @studioIcon simple-icons:instagram
*/
instagram: '',
/**
* Instagram page url
* @example https://www.youtube.com/@NuxtLabs
* @studio-icon simple-icons:youtube
* @studioIcon simple-icons:youtube
*/
youtube: '',
/**
* Medium page url
* @example https://medium.com/nuxt
* @studio-icon simple-icons:medium
* @studioIcon simple-icons:medium
*/
medium: ''
},
/**
* Theme layout configuration.
*
* @studio-icon tabler:arrow-autofit-width
* @studioIcon tabler:arrow-autofit-width
*/
layout: {
/**
Expand All @@ -86,7 +86,7 @@ export default defineNuxtConfigSchema({
/**
* Aside navigation configuration.
*
* @studio-icon fluent:document-page-24-regular
* @studioIcon fluent:document-page-24-regular
*/
aside: {
/**
Expand All @@ -110,7 +110,7 @@ export default defineNuxtConfigSchema({
/**
* Header configuration.
*
* @studio-icon fluent:document-header-24-regular
* @studioIcon fluent:document-header-24-regular
*/
header: {
/**
Expand All @@ -120,7 +120,7 @@ export default defineNuxtConfigSchema({
*
* Default to docus.title
*
* @studio-icon material-symbols:title
* @studioIcon material-symbols:title
*/
title: '',
/**
Expand All @@ -131,7 +131,7 @@ export default defineNuxtConfigSchema({
* String to be used as a name of a component.
*
* @example 'MyLogo'
* @studio-input component
* @studioInput boolean
*/
logo: false,
/**
Expand All @@ -151,15 +151,15 @@ export default defineNuxtConfigSchema({
/**
* Footer configuration
*
* @studio-icon fluent:document-footer-24-regular
* @studioIcon fluent:document-footer-24-regular
*/
footer: {
/**
* Website credits configuration.
*
* @type {false|object}
*
* @studio-icon material-symbols:copyright
* @studioIcon material-symbols:copyright
*/
credits: {
/**
Expand All @@ -175,7 +175,7 @@ export default defineNuxtConfigSchema({
*
* Will be added into center section of the footer.
*
* @studio-icon material-symbols:add-link
* @studioIcon material-symbols:add-link
*/
textLinks: {
$schema: {
Expand All @@ -199,7 +199,7 @@ export default defineNuxtConfigSchema({
*
* Icons to be added to Social Icons in footer.
*
* @studio-icon material-symbols:add-link
* @studioIcon material-symbols:add-link
*/
iconLinks: {
$schema: {
Expand Down
2 changes: 1 addition & 1 deletion tokens.config.ts
Expand Up @@ -9,7 +9,7 @@ export default defineTheme({
$schema: {
title: 'All the configurable tokens from Docus.',
tags: [
'@studio-icon material-symbols:docs'
'@studioIcon material-symbols:docs'
]
},
header: { height: '64px' },
Expand Down

0 comments on commit fd72ee2

Please sign in to comment.