Content and routes
Learn how files become ordered, localized documentation URLs without maintaining a route table.
Ginko Docs derives documentation routes from the docs collection. Folder names and filenames define the URL; numeric prefixes define order and translated identity.
Single-language content
With English as the only locale, defineGinkoDocsConfig() reads Markdown under content/docs/ and mounts it at /docs.
- content/docs
- 1.getting-started
- .navigation.yml
- 1.index.md
- 2.installation.md
- 2.guides
- 1.configuration.md
The files resolve to these public URLs:
| Source | URL |
|---|---|
1.getting-started/1.index.md | /docs/getting-started |
1.getting-started/2.installation.md | /docs/getting-started/installation |
2.guides/1.configuration.md | /docs/guides/configuration |
The index.md page owns its folder URL. Numeric prefixes do not appear in any public path.
Localized content
Set both locales in content config when English and German pages use translated slugs:
import { defineGinkoDocsConfig } from "@lupinum/ginko-docs/content";
export default defineGinkoDocsConfig({
site: {
name: "Acme Docs",
description: "Documentation for Acme.",
url: "https://docs.example.com",
},
locales: ["en", "de"],
blog: false,
});This config creates the localized content routes. Nuxt i18n also needs matching English and German locale records; the localization guide shows both configurations together.
Place each locale in its own tree. Translate the readable names, but keep the same numeric prefix chain for equivalent pages:
- content
- en/1.docs
- 1.getting-started
- 1.index.md
- 2.installation.md
- de/1.dokumentation
- 1.erste-schritte
- 1.index.md
- 2.installation.md
1.docs/1.getting-started/2.installation.md and 1.dokumentation/1.erste-schritte/2.installation.md share one translated identity. They resolve to /docs/getting-started/installation and /de/dokumentation/erste-schritte/installation.
Route behavior belongs to the layer
The layer already provides the Nuxt pages that match the English and German documentation mounts. The bare /docs and /de/dokumentation routes redirect to the first page in their localized trees.
When a project needs a different route layout, override the relevant Nuxt page through normal layer resolution. Do not call an internal Ginko Docs route API; there is no public route registry for consumers to maintain.