Skip to main content

content.config.ts

Complete reference for the Ginko Docs content factory, generated collections, sources, routes, schemas, and agent metadata.

content.config.ts defines which files belong to the site and which public routes Ginko Content derives from them. Ginko Docs exports one factory that creates the supported docs-only or docs-and-blog model.

content.config.ts
import { defineGinkoDocsConfig } from "@lupinum/ginko-docs/content";

export default defineGinkoDocsConfig({
  site: {
    name: { en: "Example Docs", de: "Example Docs" },
    description: {
      en: "Documentation for Example.",
      de: "Dokumentation für Example.",
    },
    url: "https://docs.example.com",
  },
  locales: ["en", "de"],
  blog: true,
});

Factory options

Public type
interface GinkoDocsContentOptions {
  site: {
    name: string | { en: string; de: string };
    description: string | { en: string; de: string };
    url: string;
  };
  locales?: readonly ["en"] | readonly ["en", "de"];
  blog?: boolean;
}
OptionTypeDefaultEffect
site.namestring or { en: string; de: string }requiredLocalized site title in agent-readable metadata
site.descriptionstring or { en: string; de: string }requiredLocalized site description in agent-readable metadata
site.urlstringrequiredAbsolute origin used for agent-readable links
locales['en'] or ['en', 'de']['en']Exact supported content layout; every other value throws at the boundary
blogbooleanfalseAdds the blog and authors collections and keeps blog routes enabled

Generated collections

The factory always creates docs. It adds blog and authors only when blog: true.

CollectionTypeSourceCollection route mountSitemapAgent Markdown
docspageDepends on locale mode/docs in English; /dokumentation in GermanYesSection optional
blogpage2.blog/*.md/blogYesSection blog
authorsdataauthors/**/*.jsonNoneNoNo

All three collections use strict: true. Invalid documents stop ingestion instead of passing through with a warning.

Single-locale sources

In the supported English-only mode, the docs source is independent of the localized content tree:

Single-locale content
content/
├── docs/**/*.md
├── 2.blog/*.md          # only with blog: true
└── authors/**/*.json    # only with blog: true

Docs mount at /docs and blog posts at /blog. Collection-level i18n is left unset.

Bilingual sources

With more than one locale, collection i18n is enabled and the factory uses these locale-relative globs:

Bilingual content
content/
├── en/
│   ├── 1.docs/**/*.md
│   ├── 2.blog/*.md          # only with blog: true
│   └── authors/**/*.json    # only with blog: true
└── de/
    ├── 1.dokumentation/**/*.md
    ├── 2.blog/*.md          # only with blog: true
    └── authors/**/*.json    # only with blog: true

The exact docs source pattern is {1.docs,1.dokumentation}/**/*.md. Route mounts are /docs for en and /dokumentation for de. The blog route is /blog in both locales.

With the supported English-default Nuxt I18n strategy, the resulting public docs roots are /docs and /de/dokumentation.

Generated agent configuration

The factory derives the agent site from site, enables metadata frontmatter, and includes these fields in order:

Agent metadata fields
title, description, url, route, locale, section, collection, source, updated

It creates the localized optional section with order 100. With blog: true, it also creates the localized blog section with order 40. Landing pages remain app-owned and are not duplicated as synthetic content entries.

Collection invariants

The generated model deliberately keeps one source of truth:

  • docs and blog are route-backed page collections.
  • authors is queryable data and never receives a public route, sitemap entry, or agent page.
  • Docs and blog pages opt into normalized raw Markdown, llms.txt, and llms-full.txt.
  • Drafts remain visible during development but are excluded from production agent output and public navigation.
  • Partials do not become public pages.

Use defineGinkoDocsConfig() as the complete content configuration. Re-declaring its collections beside it creates competing schemas and route policies.