Introduction

Sveltepress is a SvelteKit docs and blog site builder. Inspired by VitePress . Built on SvelteKit and UnoCSS — so you get a content toolkit and the full SvelteKit surface (SSR, adapters, server routes, hooks).

The navbar Playground opens a Feature directory of in-browser Starters. Markdown, Default Theme, and Vite plugin Entries share the Default Theme starter. Document versions ships on a Versions starter (versions init / create · versions build). Internationalization ships on a three-locale starter. Locale Playground URLs embed a same-path starter written in that language (src/routes/+page.md, config/navbar.js) — they do not add /zh/ or /bn/ routes, except the Internationalization Entry. Custom theme ships from Playground home only (there is no Guide leaf); its preview frames GlobalLayout, +layout.svelte, and PageLayout to match the layout hierarchy . Blog theme Entries (Configuration, Writing posts, Features, Customisation) share the Blog starter. Virtual modules is one Reference Entry on the Kitchen-sink starter; Open in Playground on virtual:sveltepress/site, locale, and versions all land there. Kitchen sink is the All features Entry and a Playground chrome CTA (not a site-navbar item). Blog theme and custom theme never live in that tree. Guide pages keep frozen Live code; the Blog demo stays a finished showcase.

Comparison

How does Sveltepress compare to other modern documentation solutions?

Feature / AspectSveltepressVitePressAstro (Starlight)Docusaurus
EcosystemSvelte / SvelteKitVue 3Framework-agnosticReact
Build EngineVite 8 + SvelteKit 2Vite + Vue 3Vite + Astro compilerWebpack
Fullstack PowerFull SvelteKit surface (SSR, API routes, hooks)Static-focused SSGRequires SSR adapterRequires Node plugins
ReactivitySvelte 5 Runes natively in .mdVue 3 Composition APIStatic by default (Islands)React Hooks
Interactive CodeNative live components + Twoslash hoverVue componentsRequires pluginsRequires react-live
Doc VersioningContent-addressed immutable deltas & diffsBranch/dir-basedRequires pluginsDirectory snapshot copies
SearchPagefind (built-in) / DocSearch / MeilisearchPagefind / DocSearchPagefindAlgolia / local plugins
AI Knowledge (llms.txt)Built-in automatic generationThird-party pluginThird-party pluginThird-party plugin

Project structure

Exactly the same as Project structure - SvelteKit

Except for that you can use .md files for pages or layouts. For example:

  • src/routes/+page.md is recognized as home page
  • src/routes/+layout.md is used for root custom layout
Full power of SvelteKit

Sveltepress preserves the full power of SvelteKit. You can do more than SSG. For example use +page.server.js, +layout.server.js, hooks.server.js to do some server side logic like: Authentication, DB Docking, ...

Layout hierarchy

Root layout is required

There must be a src/routes/+layout.svelte or src/routes/+layout.md as root layout file. Otherwise the global layout provided by theme would not working!

For example if your file tree look like this

.
├─ src
│  ├─ routes
│  │  └─ +layout.(svelte|md)
│  │  ├─ foo
│  │  │  ├─ +page.(svelte|md)
│  │  │  ├─ +layout.(svelte|md)
txt

theme.globalLayout > src/routes/+layout.(svelte|md) > theme.pageLayout > src/routes/foo/+layout.(md|svelte) > src/routes/foo/+page.md

Here's a graph to help you understand

Layout Nesting Hierarchy

Visualizing how global themes, project layouts, and leaf pages wrap into each other

theme.globalLayout
Theme
src/routes/+layout.(svelte|md)
Project File
theme.pageLayout
Theme
src/routes/foo/+layout.(md|svelte)
Project File
src/routes/foo/+page.(md|svelte)
Page Content
Documentation Page Content Page Slot Center

Markdown technical documentation, code blocks, or custom Svelte components render here...

Configuration

Sveltepress's config is passed to @sveltepress/vite vite plugin, all options are fully typed.

Read Vite plugins options for more details.

Deployment

It is recommended to read Adapters - SvelteKit first. If you use npm/yarn/pnpm create @sveltepress to create a new project. The Adapter Static would be used as default.

But feel free to change to any adapters you want.

Last update at: 2026/09/16 04:21