Configuration
The app config keys, module options and collection options @maas/docs reads.
The layer reads three places: docs in app.config.ts names the site, docs in nuxt.config.ts steers the build, and defineDocsCollections says where the pages come from.
App config
app/app.config.ts
export default defineAppConfig({
docs: {
title: 'Mirror',
titleSuffix: 'Mirror by Magic as a Service™',
description: 'Tokens, utilities and unstyled components for Vue.',
url: 'https://mirror.maas.engineering',
version: '2.0.0',
repository: 'https://github.com/magicasaservice/mirror',
image: { src: '/og-image.jpg', alt: 'A glossy violet button' },
previewThemes: ['mono'],
},
})
Module options
nuxt.config.ts
export default defineNuxtConfig({
extends: ['@maas/docs'],
docs: {
tokens: '../../.maas',
sources: ['../../packages/components'],
previews: ['../../packages/components/*/demo/*.vue'],
},
})
Collections
defineDocsCollections returns the three collections the layer queries: home for index.md, docs for every other page, and docsRaw, which serves each page as Markdown at /raw/<path>.md.
content.config.ts
import {
defineContentConfig,
defineDocsCollections,
z,
} from '@maas/docs/content'
export default defineContentConfig({
collections: defineDocsCollections({
source: [
{ include: '0.overview/*.md' },
{
cwd: '../../packages/plugins',
include: '*/index.md',
prefix: '/1.plugins',
},
],
schema: {
since: z.string().optional(),
},
}),
})
The docs collection reads these front matter fields on top of title and description.