Clew Manual

Sharing your work

Publishing as a website

File → Export → Vault as Website… compiles an entire vault into a folder of static web pages: every note becomes an .html page, wikilinks turn into real relative links, attachments copy over in place, and a single assets/ folder carries everything the pages need. The result works on any web host — or straight from disk — with no server code, no build step, and no subscription. It is, in short, Obsidian Publish as a menu item.

Running an export

Choose File → Export → Vault as Website… (or the palette command Export vault as website…). Clew asks you to pick a destination folder; the site is written into a subfolder of it named after the vault with a -site suffix — exporting a vault called research into ~/Sites produces ~/Sites/research-site/. A notice appears while the export runs, and when it finishes another gives the page count, the output path, and the number of pages that failed to build, if any.

Every Markdown note in the vault (.md and .jmd) is rendered through the same jmarkdown engine that powers reading mode, with the vault's own render settings applied — so what you see in the app is what the site shows. The vault's folder structure is preserved: Guide/Maps.md becomes Guide/Maps.html. Hidden folders and app internals (.clew/, .obsidian/, .git/, and so on) are skipped. Everything that is not a note — images, PDFs, audio, video, arbitrary attachments — is copied to the same relative location, so nothing a page references goes missing.

The export is fast in a way worth a sentence: each page builds in a fresh engine process, but the next process warms up while the current page renders, so a vault of dozens of notes pays the engine's start-up cost roughly once, not once per note. A page that fails to render does not stop the run; it is recorded and reported at the end, and the rest of the site still builds. As a benchmark, the demo vault that ships with Clew exports to roughly forty pages with zero failures.

How each piece translates

The interesting question about a static export is always what survives the trip. The answer here is: nearly everything you can read, and deliberately nothing you could write.

Links become real links

Inline [[wikilinks]] are rewritten as genuine relative <a href> links to the corresponding pages, correct for each page's depth in the folder tree — a link from Guide/Maps.html up to Welcome.html comes out as ../Welcome.html. Heading links ([[Note#Section]]) carry their anchors along. A wikilink whose target does not exist in the vault is rendered as inert styled text rather than a broken link. Note embeds (![[Note]]) are expanded in place as they are in reading mode, and media embeds point at the copied attachments.

Rendering survives wholesale

Mathematics, theorem environments, citations and bibliographies, footnotes, alerts, mermaid diagrams, media embeds with their sizes — all of it renders on the exported pages exactly as in reading mode, because it is the same engine doing the rendering. The assets/ folder ships local copies of the runtime pieces (MathJax, mermaid, highlighting styles, Font Awesome, jQuery, Leaflet, and the preview stylesheet), so the pages do not depend on a CDN.

Maps stay interactive

Leaflet maps — including photo maps — keep their pins, popups, panning, and zooming. A small static runtime script on every page initialises them against the exported assets. Map tiles still come from the tile server the map uses, as they do in the app.

Figures bake to SVG

TikZ and MetaPost figures are typeset during the export and written into the pages as vector SVG, so a published site carries no engine at all: a visitor loads a few kilobytes of graphics rather than the 74 MB of wasm TeX the app ships, and the server needs no TeX either. Identical figures across pages are typeset once. A figure that fails shows its error log on the page, and the export reports how many did. A figure set in the note's own typeface is baked as glyph outlines rather than text, so the page carries no copy of that font — and looks the same to a visitor who does not have it.

Queries bake to snapshots

Query tables, task lists, and kanban boards are rendered with the data the vault held at export time, then frozen. A published dashboard is a snapshot of the vault the moment you exported — which is exactly what a website should be. What does not carry over is the writing-back: cells are not editable, checkboxes do not toggle, cards do not drag, because the site has no vault to write to.

Vault scripts ship with the site

The vault's shared JavaScript — .clew/scripts/*.js, the vault scripts mechanism — is copied into assets/vault-scripts/ and loaded on every page, in the same alphabetical order as in the app. Custom elements defined there render their content on the published site just as they do in reading mode. Inline scripts written into notes also ship as part of their pages; see the caution below for what they can and cannot do once published.

What deliberately does not carry over

A static site is a collection of documents, and the export is honest about that:

Caution — the export does not prune Exporting writes pages into the destination folder but never deletes from it. If you re-export after renaming or removing notes, pages for the old names remain from the previous run. For a site you publish repeatedly, either delete the site folder before re-exporting or export to a fresh folder each time and swap it into place.

The home page

Alongside the per-note pages, the export creates an index.html so the site has a front door. It is a copy of the first of these notes found at the vault root: Welcome.md, Start Here.md, Home.md, or index.md — and failing all four, the first note the export encountered, provided it sits at the root. If nothing qualifies, no index.html is produced; give the vault a root-level Welcome.md (a good idea anyway — see Vaults and files) and it becomes the landing page.

Tip — design the Welcome note as your front page Since the home note doubles as the site's landing page, it pays to make it a hub: a short introduction and a handful of wikilinks into the vault's main areas. The demo vault's Welcome note is built exactly this way, and the exported demo site inherits its structure for free.

Hosting the result

The output folder is self-contained static HTML: any web host that can serve files can serve it. Copy it to GitHub Pages, Netlify, an S3 bucket, the public_html of a university account, or a Raspberry Pi running nginx — there is no server component, no database, and no build pipeline to install. The pages also open directly from disk, so double-clicking index.html is a perfectly good way to check the export before uploading it.

Re-exporting after you change the vault is the whole publishing workflow: run the menu item again and upload the folder. Because the site is a pure function of the vault, there is no separate content management step — the vault is the CMS.

Obsidian compatibility This feature occupies the same niche as Obsidian Publish, but as a local export rather than a hosted service: no subscription, no account, and the output is a folder you control. A vault shared between the two apps publishes from Clew with all of Clew's rendering (mathematics, citations, maps, query snapshots) applied.

Reference

Vault contentOn the published site
Note (.md, .jmd) An .html page at the same relative path.
[[Wikilink]] / [[Note#Heading]] A real relative link, depth-correct, with the heading anchor; unresolved targets become inert styled text.
Note and media embeds Expanded in place / pointing at the copied files.
Math, theorems, citations, footnotes, alerts Rendered as in reading mode, from local assets.
Mermaid diagrams Rendered on page load by the shipped mermaid runtime.
Leaflet and photo maps Fully interactive; pins and popups preserved.
Query / tasks / kanban blocks Baked to a read-only snapshot of export-time results.
Attachments and other files Copied unchanged, structure preserved.
Vault scripts (.clew/scripts/*.js) Shipped in assets/vault-scripts/ and loaded on every page, alphabetically.
Note scripts using the Note API Ship with their pages but find no window.clew; well-written ones degrade to static content.
Canvas embeds A labelled placeholder box.
Preview-surface plugins Not included.
.clew/, .obsidian/, .git/, dotfiles Skipped entirely.
OutputDetail
DestinationA <vault-name>-site/ subfolder of the folder you pick in the dialog.
index.htmlCopy of the first found root note among Welcome.md, Start Here.md, Home.md, index.md, else the first note found if it sits at the root.
assets/MathJax, mermaid, highlight styles, Font Awesome, jQuery, Leaflet (with images), the preview stylesheet, the static runtime, and vault scripts.
Server requirementsNone — static files only; the site also opens directly from disk.

See also