Customization
Project Structure
Understand the key files and folders in a Tiramisu Docs project built on SvelteKit.
A Tiramisu Docs project follows a standard SvelteKit layout with a few Tiramisu-specific conventions.
File Tree
my-docs
src
docs
en
getting-started.tiramisu
guide.tiramisu
lib
tiramisu.config.ts
components
index.ts
tiramisu
MyCustomWidget.svelte
routes
docs/[...slug]
+page.svelte
+page.ts
app.css
svelte.config.js
vite.config.ts
package.json
Key Files
| File | Purpose |
|---|---|
src/lib/tiramisu.config.ts | Main configuration file. Defines title, sections, sidebar, i18n, and more. |
src/docs/ | Documentation content. Each .tiramisu file becomes a page. |
src/lib/components/index.ts | Component barrel file. Re-exports all kit components. Edit to override any built-in. |
src/lib/components/tiramisu/ | Custom components. Any Svelte component here can be used as a Tiramisu function. |
src/routes/docs/[...slug]/ | The catch-all route that renders documentation pages. |
vite.config.ts | Vite configuration with the tiramisuPlugin(). |
svelte.config.js | SvelteKit adapter configuration. |
src/app.css | Global styles. Import the Tiramisu theme here. |
The Docs Route
The src/routes/docs/[...slug]/ directory contains two files that power the documentation:
+page.ts loads the compiled Tiramisu content and metadata:
import { loadDoc } from "@tiramisu-docs/kit";
export const load = loadDoc; +page.svelte renders the documentation layout:
<script>
import { DocsLayout } from "@tiramisu-docs/kit";
let { data } = $props();
</script>
<DocsLayout {...data}>
<data.component />
</DocsLayout>