Type to search pages and sections.

Skip to content
Ginko

Docs layer exports

What @lupinum/ginko-docs offers publicly. The package entry points, the functions for ginko.config.ts, the option in nuxt.config.ts, the components, the override points and what stays internal.

Entry points

@lupinum/ginko-docs has four entry points. Import only these paths; every other file in the package is internal and can change in any release.

Entry pointWhat it is
@lupinum/ginko-docsThe Nuxt layer for extends in nuxt.config.ts
@lupinum/ginko-docs/configThe bricks and page addresses for ginko.config.ts
@lupinum/ginko-docs/pagesNuxt module that registers the layer's pages. The layer loads it itself.
@lupinum/ginko-docs/iconsNuxt module that bundles the icons at build time. The layer loads it itself.

Do not add the two modules to modules: extends: ['@lupinum/ginko-docs'] brings them along.

The layer

ts
// nuxt.config.ts
import ginko from './ginko.config.ts'

export default defineNuxtConfig({
  extends: ['@lupinum/ginko-docs'],
  modules: ['@lupinum/ginko/nuxt'],
  ginko,
})

The entry point is the layer's configuration, not a collection of functions. Through Nuxt's layer mechanism it adds pages, layout, components, CSS and the modules above, plus @lupinum/ginko-components.

The only option in nuxt.config.ts is ginkoDocs.brick: the key of the docs brick when it is not docs.

ts
// nuxt.config.ts
export default defineNuxtConfig({
  extends: ['@lupinum/ginko-docs'],
  ginkoDocs: { brick: 'wissen' }, // the same key as docsCollection({ brick: 'wissen' })
})

config

ts
import { blogCollections, blogPages, changelogCollection, changelogPages, components, docsCollection, docsHome, homePages } from '@lupinum/ginko-docs/config'
import type { DocsSource } from '@lupinum/ginko-docs/config'
ExportKindPurpose
docsCollection({ locales, base?, source?, navExtras?, brick?, label?, max? })FunctionThe docs brick. Pages under base (default /docs).
docsHome({ source? })FunctionThe optional start page: content/home.md.
blogCollections({ locales, source?, max? })FunctionThe optional blog: { posts, authors }, spread into bricks.
changelogCollection({ source?, max? })FunctionThe optional changelog.
homePages({ locales })FunctionThe start page's addresses by locale, for pages.
blogPages({ locales })FunctionThe blog list's addresses by locale, for pages.
changelogPages({ locales })FunctionThe changelog's addresses by locale, for pages.
componentsObjectThe registry of the Markdown components of @lupinum/ginko-components, for components in defineSite.
DocsSourceType'files' (default) or 'platform': where a brick reads its content from.

The bricks read files unless you say otherwise: docs usually live in Git. With source: 'platform' the content lives on the platform, and editors change it in the Studio. How to use the functions is on Docs sites.

App config

The options go under docs in the site's app.config.ts. The layer extends the types of defineAppConfig, so TypeScript checks every option without a type import. The list of options is on Docs sites.

The layer's texts are messages under docs.*. The site's own messages win key by key. The layer brings English, German and French.

Components

These components are public and stay stable between releases:

ComponentProps and slotsPurpose
<DocsSearch />shortcut (default true): / and Ctrl/⌘ K open the searchThe search, for example in the site's own header
<DocsLanguage />list: a row of links instead of a menuThe languages of the current page
<DocsThemeToggle />segmented: the three-way Auto/Light/Dark switchThe light/dark switch
<DocsShell>slot default for the page, slot bar for controls in the phone barNavigation and search around a page of your own
<Icon name="lucide:…" />nameAn icon from the layer's bundle. If the site installs @nuxt/icon, its Icon wins.

Two empty components are override points. The site replaces them with its own file of the same name in app/components/:

ComponentPropsWhere it appears
DocsPageEnddoc, the page's entryAfter the text of every docs page, before "Edit this page" and the pager
DocsSidebarEndnoneBelow the navigation, in the sidebar and in the phone menu

Examples are on Theming and overrides.

Internal

Everything else is internal and can change in any release: the other Docs* components, the useDocs* composables, the files under app/ and the CSS classes. The functions that @lupinum/ginko-docs/icons exports next to the module are there for the package's tests. For the look, the tokens on Theming and overrides are the public interface, not the classes.