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 a small SvelteKit shell, svartz.config.ts, and vault/index.md. 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.
For build and test automation, copy the GitHub Actions example into the new project.
In an existing SvelteKit app, 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. In a SvelteKit host, all vaults share one build even when--vaultis given.- 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.
For this repository's apps/web shell, 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 active app/workspace root, so published themes can be installed at the workspace root without becoming dependencies of
@svartz/vite. - 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:
apps/weband 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,
apps/web/vite.config.ts, 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.
apps/web no longer uses giant inline string-literal virtual modules for Vitest.
- Test runtime fixtures live in
apps/web/src/lib/svartz/testing/fixtures/. apps/web/vite.config.tsaliasesvirtual:svartz/themeandvirtual:svartz/artifactsto those files only in Vitest mode.
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.