# Configuration

> Configure the site, sidebar, API reference, SEO and theme from astro.config.mjs.

Everything is configured through the `lyvo()` integration in `astro.config.mjs`. Every option is optional, and unknown options fail the build with a clear message.

```js title="astro.config.mjs"

	site: 'https://my-app.dev',
	integrations: [
		lyvo({
			title: 'My App',
			description: 'Docs for My App',
			repo: { url: 'https://github.com/my-org/my-app' },
			openapi: { input: 'public/openapi.json' }
		})
	]
});
```

<Callout type="warning" title="Set site">
	Canonical URLs, OG images, the sitemap and `robots.txt` all need Astro's `site` option. The
	build warns when it's missing.
</Callout>

## Sidebar

Leave `docs.sidebar` out and the sidebar is built from your folders, sorted by frontmatter `order`. To define it yourself, list doc ids, separators, groups and links:

```js
docs: {
	sidebar: [
		'introduction',
		{
			title: 'Guides',
			items: ['guides/install', { title: 'Advanced', items: ['guides/tuning'] }]
		},
		'---',
		{ title: 'GitHub', href: 'https://github.com/my-org/my-app' }
	];
}
```

## API reference

```js
openapi: [
	{ input: 'public/openapi.json', prefix: '/api' },
	{ input: 'public/v2.json', prefix: '/api/v2', title: 'API v2', snippets: ['curl', 'python'] }
];
```

- Every endpoint gets its own page, every schema in `components.schemas` gets a model page under `/api/schemas/`.
- `snippets` picks the code sample languages: `curl`, `javascript`, `python`, `go`, `csharp`, `java`.
- `playground: false` hides the "Try it" panel. Requests run in the browser, so your API must allow CORS from the docs origin.
- An invalid spec fails the build instead of silently dropping the reference.

## SEO and social images

There's nothing to configure. Every page gets a canonical URL, Open Graph and Twitter tags, JSON-LD and a generated 1200x630 image. With locales, pages get hreflang links and untranslated fallbacks point their canonical at the original.

Use `og: { image: '/social.png' }` for one static image instead, or `og: { generate: false }` to skip images.

## LLMs

Every docs and API page has a Markdown twin: add `.md` to the URL, like [/docs/introduction.md](/docs/introduction.md). `/llms.txt` lists them all and `/llms-full.txt` has the full content in one file. The "Copy page" button at the top of each page copies the Markdown or opens it in ChatGPT or Claude.

Turn it all off with `llms: false`.

## Theme

Colors come from CSS variables. Add a file to `customCss` and override tokens:

```css title="src/styles/custom.css"
@theme {
	--color-primary: oklch(0.5 0.2 250);
}
```

The file joins the theme's Tailwind root, so don't import `tailwindcss` in it.
