Configuration
Configure Imprensa in vite.config.ts with the imprensa() Vite plugin.
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.
imprensa({ hostname: "https://docs.example.com" });
contentDir
The MDX content directory. Defaults to src/pages/(content).
imprensa({ contentDir: "src/pages/docs" });
head
Default metadata for pages. Page frontmatter can override it.
imprensa({
head: {
title: "My Docs",
description: "Documentation for my project.",
},
});
socials
Links shown by the starter navigation components.
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”.
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.
imprensa({ detectDeadLink: true }); // default
Temporarily disable it during migrations:
imprensa({ detectDeadLink: false });
Syntax highlighting
Shiki is enabled by default. Configure loaded languages and themes, or disable it for a lighter build.
imprensa({
shiki: {
themes: { light: "night-owl-light", dark: "houston" },
langs: ["ts", "tsx", "mdx", "shell", "json"],
twoslash: true,
},
});
imprensa({ shiki: false });
Generated artifacts
By default Imprensa emits:
- prerendered HTML for every route
sitemap.xmlwhenhostnameis setllms.txt,llms-full.txt, andllms.jsonfor AI agents
Disable AI exports if you do not want them published:
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.
imprensa({
preview: {
importmap: JSON.stringify({ imports: { "my-lib": "https://esm.sh/my-lib" } }),
head: `<script src="https://cdn.tailwindcss.com"></script>`,
},
});