A SvelteKit publishing toolkit for Obsidian vaults, inspired by Quartz.
Svartz is a set of tools that helps you publish your digital garden and notes as a website for free.
Some notable differences from Quartz are:
- A plugin pipeline with replaceable transformers and generators.
- Markdown notes stay inert. Use
.svxfor authored Svelte components. - Multiple vaults and a built-in minimal theme. Vault locations live in
svartz.config.ts.
From the repo root, run pnpm i once, then pnpm build.
Initialize the current directory without cloning this repository:
npx svartz@latest init
npm run devThe initializer creates svartz.config.ts and vault/index.md, and nothing else: the svartz package ships the app every vault builds with. It uses npm by default and an existing project's package manager when one is declared. npm run build creates the static site; npm run preview serves the built output.
One config can publish several sites. Each vault picks its own theme and target, so two cloudflare-workers vaults deploy as two Workers on their own domains; see several sites from one config.
For build and test automation, copy the GitHub Actions example into the new project.
An existing SvelteKit app can also mount vaults in its own routes, for content inside an app that is otherwise not a Svartz site. There, the same command adds Svartz dependencies, configuration, and a Vite wrapper while preserving routes, layouts, adapter, and existing scripts. It adds svartz:dev, svartz:build, and svartz:preview scripts. Existing vault definitions remain in their config; init does not replace them. Use --no-install or --no-git when you want to handle those steps yourself.
Configure vault mounts and canonical routes when an existing app serves notes under paths such as /journal.
One SvelteKit host can compose multiple mounted vaults in a single build.
The local CLI is vault-aware:
pnpm exec svartz build
pnpm exec svartz build --vault docs
pnpm exec svartz dev --vault docssvartz buildbuilds every configured vault. Host vaults share one build in the host app, even when--vaultnames one of them; every other vault builds on its own.- Vault artifacts live under
.svartz/vaults/<vault-id>. A host app's adapter decides its site output path. - Standalone vault builds keep SvelteKit internals under
.svartz/vaults/<vault-id>/.svelte-kit.
In a Turborepo workspace such as this one, the CLI also syncs root-level Turbo/package automation for the configured vaults:
- Root
package.jsonscripts are managed under thesvartz:*namespace. - Root
turbo.jsontasks are managed under//#svartz:*. //#svartz:builddepends on one//#svartz:build:<vault-id>task per configured vault.- Per-vault
svartz:dev:<vault-id>andsvartz:preview:<vault-id>tasks are synced so you can run multiple vault processes through Turbo's TUI.
Examples:
turbo run svartz:build
pnpm svartz:dev
pnpm svartz:preview@svartz/theme-minimalis the built-in fallback theme used when config does not specify one.- Any other configured theme is resolved from the project root, beside
svartz.config.ts, so published themes are ordinary dependencies of the project. - During
svartz dev, source aliasing only applies to theme packages that resolve to a local workspace package; published themes are loaded from their installed package entry instead. - Tailwind source scanning is generated per vault by the CLI: the shipped app and initialized hosts import a virtual CSS bridge, and the CLI writes that file with
@sourcedirectives for the resolved theme and its component-library dependencies. Host builds include the Tailwind entry so packed theme utilities reach emitted CSS. The CLI ships the forms and typography plugins that entry loads; hosts provide onlytailwindcss4.
svartz dev uses two watch modes on purpose:
- Vault content changes:
@svartz/viterebuilds the Svartz pipeline in-process, rewrites the generated runtime bridge modules, and triggers a browser full reload. - Config, the app's Vite config, active theme code, and best-effort workspace package source changes: the CLI rebuilds affected workspace packages if needed and restarts the dev runner cleanly.
Current behavior is correctness-first:
- Vault edits do a full pipeline rebuild plus browser full reload, not fine-grained per-stage HMR.
- Restart-class changes are process restarts, not unsafe hot-swaps.
- Workspace package watching currently targets
packages/config/src,packages/core/src,packages/plugins/src,packages/vite/src,packages/ui/src, plus the active theme package source.
The runtime page's tests render against a stub one-vault host in packages/ui/src/lib/runtime/testing/shell/, which each test file mocks in for virtual:svartz/host.
Host apps and themes can read the published vault view from virtual:svartz/artifacts.
@svartz/vitetests cover vault change classification, rebuild triggering, and browser full-reload signaling.