vaw Wiki
Reading preferences
Text size

Themes and templates

On this page

Themes and templates#

The default theme is embedded in the VAW executable. It renders independent HTML pages with a responsive note explorer, technical reading column, table of contents, metadata, backlinks, and optional local graph. Content stays usable without JavaScript; controls that require JavaScript appear only after the frontend initializes.

Configuration#

theme:
  name: default
  appearance: system        # system, light, dark
  typography: editorial     # editorial, technical, minimal
  accent_color: "#2856c5"  # six digit hex color
  content_width: 780px     # integer px, ch, or rem
  custom_css: theme/custom.css
  directory: theme

theme.appearance sets the initial appearance. Readers can switch between light and dark mode; their choice is stored in browser local storage under the VAW theme key. The built-in layout uses cool neutral surfaces, cobalt accents, and system font stacks with no external font or script dependencies. Explicit theme.accent_color values continue to override the default.

Article pages expose text size, code wrapping, and reader mode from the Aa menu in the top bar, keeping the article opening free of controls. Text size uses a paired control; the remaining actions appear as compact menu rows, with active toggles highlighted. A thin bar under the top bar reports reading progress, headings expose permalink anchors on hover or focus, and links to other sites carry a small outbound marker. Reader mode hides the sidebars and is remembered separately from explorer and text-size preferences. Outlines show primary headings first; More headings reveals deeper sections. Related links and Explore graph remain expanded. The local graph loads when its panel becomes visible. Open graph opens a larger interactive popup, also available from the Aa menu. Escape or Close graph closes it and returns focus to its trigger. On narrower screens, contextual navigation moves into disclosures.

Browse and tag pages list one row per note with its description, folder, and tag links, followed by client-side filtering and sorting when JavaScript is available. Without JavaScript the full list remains readable.

theme.typography selects the built-in heading and reading style. editorial uses serif headings, technical uses a compact sans-serif hierarchy, and minimal uses a quieter sans-serif hierarchy. All three presets work offline.

The configuration accent and reading width become CSS variables. A trusted owner stylesheet can override them and the other theme variables. When theme.custom_css is empty, VAW looks for theme.directory/custom.css if a theme directory is set. Otherwise only the embedded CSS is used. Custom CSS is copied into the output with a content fingerprint; treat it as trusted code because it can load external resources or change how content is displayed.

Template override#

Set theme.directory to a directory containing templates/page.html to replace the full page template:

my-notes/
├── content/
├── theme/
│   ├── custom.css
│   └── templates/
│       └── page.html
└── vaw.yaml

The override is parsed with Go's html/template. It receives the renderer's page data, including .Title, .SiteTitle, .Description, .HTML, .Headings, .Tags, .Explorer, .Backlinks, .Related, and the base-path-aware asset URLs. .HTML is the sanitized HTML produced from the published Markdown pipeline. Keep automatic escaping for every other value; do not wrap note-controlled fields in template.HTML in custom Go code.

An override replaces the complete default document. It should preserve a semantic main landmark with id="main", keyboard focus styles, the local static-asset URLs, the search dialog and data attributes if it retains interactive features. Replacing the template can remove built-in accessibility and progressive-enhancement behavior, so test desktop, mobile, keyboard, and JavaScript-disabled output after changes.

Themes are trusted owner configuration. Note content cannot select a template, CSS file, script, or theme directory. Markdown parsing and publishing policy remain independent of the theme.

Bundled frontend assets#

The frontend source is in web/. Contributors use the pinned npm dependencies and npm run build --prefix web; the build compiles and copies assets into internal/renderer/assets, which Go embeds. Official generator builds therefore need no Node.js when generating a site. KaTeX fonts are included locally, and THIRD_PARTY_NOTICES.txt is kept in the repository and shipped with release archives rather than published into generated sites. Generated websites do not fetch fonts, search libraries, graph code, Mermaid, or KaTeX from a CDN.

Linked notes

Related notes

Linked from

Search is ready.

    ↑ ↓ move · Enter open · Esc close

    Explore graph

    Open the graph to explore note relationships.