Multi-Tab Sites
Sourcey supports multiple tabs, each with its own source adapter: markdown groups, MkDocs, an OpenAPI spec, an MCP snapshot, Doxygen XML, or native godoc data. Tabs appear in the top navigation and define independent URL namespaces.
Tab types
Each tab has exactly one content source:
| Source | Adapter | Use case |
|---|---|---|
| Markdown groups | markdown({ groups }) | Guides, tutorials, concepts, changelogs |
| MkDocs | mkdocs("./mkdocs.yml") | Import an existing MkDocs site |
| OpenAPI spec | openapi("./openapi.yaml") | Auto-generated API reference |
| MCP snapshot | mcp("./mcp.json") | MCP server tools, resources, and prompts |
| Doxygen XML | doxygen({ xml }) | C/C++ API reference |
| Go packages | godoc(".") | Go package and symbol reference |
Example: five-tab site
import { defineConfig, godoc, markdown, openapi } from "sourcey";
export default defineConfig({
name: "My Platform",
navigation: {
tabs: [
{
tab: "Documentation",
slug: "",
source: markdown({
groups: [
{
group: "Getting Started",
pages: ["introduction", "quickstart"],
},
{
group: "Concepts",
pages: ["architecture", "authentication"],
},
],
}),
},
{
tab: "Guides",
source: markdown({
groups: [
{
group: "Tutorials",
pages: ["guide-setup", "guide-deployment"],
},
],
}),
},
{
tab: "API Reference",
slug: "api",
source: openapi("./openapi.yaml"),
},
{
tab: "Go API",
slug: "go-api",
source: godoc({
module: ".",
packages: ["./..."],
}),
},
{
tab: "Changelog",
source: markdown({
groups: [
{
group: "Updates",
pages: ["changelog"],
},
],
}),
},
],
},
});How slugs work
Each tab has a URL slug. Pages within a tab are prefixed with that slug.
{ tab: "Documentation", slug: "" }Pages live at the root: /introduction, /quickstart.
Use this for your primary tab to keep URLs short.
{ tab: "Guides", slug: "guides" }Pages are prefixed: /guides/guide-setup, /guides/guide-deployment.
When slug is omitted, it defaults to the slugified tab name.
{ tab: "API Reference", slug: "api" }Override the auto-generated slug for cleaner URLs: /api/ instead of /api-reference/.
Set slug: "" on your primary documentation tab. This puts the most-visited pages at the shortest URLs.
Groups within tabs
Groups organize pages in the sidebar. Each group gets a section header.
source: markdown({
groups: [
{
group: "Getting Started", // sidebar section header
pages: ["introduction", "quickstart"],
},
{
group: "Advanced",
pages: ["architecture", "performance"],
},
],
});Pages appear in the sidebar in the order they're listed. Groups appear in the order they're defined.
Real-world example
The Cheese Store demo uses the same multi-tab pattern for guides and OpenAPI reference. The Scafld Go API is the live godoc reference: a Go API tab generated from package comments and exported symbols.
