Skip to content

Configuration

The app config keys, module options and collection options @maas/docs reads.

View source View as Markdown

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'],
  },
})
KeyType
title
string
titleSuffix
string
description
string
url
string
version
string
repository
string
image
{ src: string, alt: string }
links
Array<{ label: string, href: string }>
previewThemes
Array<string>

Module options

nuxt.config.ts
export default defineNuxtConfig({
  extends: ['@maas/docs'],
  docs: {
    tokens: '../../.maas',
    sources: ['../../packages/components'],
    previews: ['../../packages/components/*/demo/*.vue'],
  },
})
OptionTypeDefault
tokens
stringThe tokens @maas/docs ships with
sources
Array<string>[]
previews
Array<string>[]

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(),
    },
  }),
})
OptionType
source
string | CollectionSource | Array<CollectionSource>
schema
z.ZodRawShape

The docs collection reads these front matter fields on top of title and description.

FieldType
badge
string
pending
boolean
dataAttributes
Array
cssVariables
Array
guidelines
Array