---
title: Configuration
description: Configure the imprensa Vite plugin, metadata, search inputs, code highlighting, and generated artifacts.
order: 2
tags: [config, plugin]
---

# Configuration

Configure Imprensa in `vite.config.ts` with the `imprensa()` Vite plugin.

```ts
import { defineConfig } from "vite";
import { imprensa } from "imprensa";

export default defineConfig({
  plugins: [imprensa({ hostname: "https://docs.example.com" })],
});
```

## Common options

### `hostname`

The public origin of the site. Set this for correct sitemap and absolute metadata URLs.

```ts
imprensa({ hostname: "https://docs.example.com" });
```

### `contentDir`

The MDX content directory. Defaults to `src/pages/(content)`.

```ts
imprensa({ contentDir: "src/pages/docs" });
```

### `head`

Default metadata for pages. Page frontmatter can override it.

```ts
imprensa({
  head: {
    title: "My Docs",
    description: "Documentation for my project.",
  },
});
```

### `socials`

Links shown by the starter navigation components.

```ts
imprensa({
  socials: [
    { service: "github", url: "https://github.com/you/repo" },
    { service: "x", url: "https://x.com/you" },
    { service: "discord", url: "https://discord.gg/invite" },
  ],
});
```

### `repo`, `repoBranch`, `repoPath`

Repository metadata for doc toolbar actions such as “Open in GitHub” and “View as Markdown”.

```ts
imprensa({
  repo: "https://github.com/you/repo",
  repoBranch: "main",
  repoPath: "docs", // optional path prefix inside the repository
});
```

## Content checks

`detectDeadLink` validates internal links and heading anchors during build. Keep it enabled for published docs.

```ts
imprensa({ detectDeadLink: true }); // default
```

Temporarily disable it during migrations:

```ts
imprensa({ detectDeadLink: false });
```

## Syntax highlighting

Shiki is enabled by default. Configure loaded languages and themes, or disable it for a lighter build.

```ts
imprensa({
  shiki: {
    themes: { light: "night-owl-light", dark: "houston" },
    langs: ["ts", "tsx", "mdx", "shell", "json"],
    twoslash: true,
  },
});
```

```ts
imprensa({ shiki: false });
```

## Generated artifacts

By default Imprensa emits:

- prerendered HTML for every route
- `sitemap.xml` when `hostname` is set
- `llms.txt`, `llms-full.txt`, and `llms.json` for AI agents

Disable AI exports if you do not want them published:

```ts
imprensa({ llms: false });
```

## Preview sandbox

Code fences marked `preview` render in an iframe. Add import map entries or extra iframe head HTML when your examples need them.

```ts
imprensa({
  preview: {
    importmap: JSON.stringify({ imports: { "my-lib": "https://esm.sh/my-lib" } }),
    head: `<script src="https://cdn.tailwindcss.com"></script>`,
  },
});
```
