Configuration
All configuration goes in onedocs.config.ts at your project root.
Basic setup
import { defineConfig } from "onedocs/config";
export default defineConfig({
title: "My Project",
description: "Documentation for My Project",
});That's the minimum. Everything else is optional.
Full example
import { defineConfig } from "onedocs/config";
export default defineConfig({
title: "My Project",
description: "Documentation for My Project",
// Logo (string or light/dark variants)
logo: "/logo.svg",
// logo: { light: "/logo-light.svg", dark: "/logo-dark.svg" },
// Navigation bar
nav: {
links: [
{ label: "Blog", href: "/blog" },
{ label: "Changelog", href: "/changelog" },
],
github: "username/repo",
},
// Homepage
homepage: {
hero: {
title: "My Project",
description: "The best documentation framework",
cta: { label: "Get Started", href: "/docs" },
},
features: [
{
title: "Fast",
description: "Built on Next.js for optimal performance",
},
{
title: "Simple",
description: "Write markdown, get docs",
},
],
},
// Docs
docs: {
dir: "content/docs",
},
// Theme
theme: {
primaryColor: "#3b82f6",
darkMode: true,
},
// i18n (optional)
i18n: {
defaultLanguage: "en",
languages: ["en", "es", "de"],
},
});Options
title (required)
Your site's name. Shows in the navbar and page titles.
title: "My Project"description
Short description for meta tags and the homepage.
description: "Documentation for My Project"logo
Your logo. Can be a single path or light/dark variants.
// Single logo
logo: "/logo.svg"
// Light/dark mode
logo: {
light: "/logo-light.svg",
dark: "/logo-dark.svg"
}nav
Navigation bar configuration.
nav: {
// Extra links in the navbar
links: [
{ label: "Blog", href: "/blog" },
{ label: "API", href: "/api" },
],
// GitHub repo (adds icon link)
github: "username/repo",
}homepage
Homepage hero and features.
homepage: {
hero: {
title: "My Project", // Defaults to config.title
description: "Description", // Defaults to config.description
cta: {
label: "Get Started",
href: "/docs",
},
},
features: [
{
title: "Feature 1",
description: "Description of feature 1",
icon: "rocket", // Optional
},
],
}docs
Where your markdown files live.
docs: {
dir: "content/docs", // Default
}theme
Customize colors and dark mode.
theme: {
primaryColor: "#3b82f6",
darkMode: true, // Default: true
}i18n
Multi-language support.
i18n: {
defaultLanguage: "en",
languages: ["en", "es", "de", "fr"],
}TypeScript
The defineConfig helper gives you full autocompletion:
import { defineConfig, type OnedocsConfig } from "onedocs/config";
const config: OnedocsConfig = {
title: "My Project",
};
export default defineConfig(config);