zer0-pages — Architecture Contract¶
One repo, one body of content, two consumers: Obsidian (authoring/browsing) and Jekyll (publishing). The vault is never polluted with Liquid; the site never requires Obsidian. Every change must preserve that dual compatibility.
Repo layout¶
zer0-pages/
├── claude-obsidian/ ENGINE — git submodule; authoring skills
│ (/wiki-ingest, /wiki-query, /save, /autoresearch, ...)
│ Never modify: it is an upstream submodule.
├── pages/ VAULT + JEKYLL SOURCE (open this dir in Obsidian)
│ ├── _docs/ _posts/ _notes/ the three content collections
│ ├── _moc/ Maps of Content — Home / Docs / Posts / Notes
│ ├── _templates/ Obsidian note templates (excluded from build)
│ ├── .raw/ immutable ingest drop zone (excluded from build)
│ ├── wiki/ claude-obsidian knowledge base (index/log/hot)
│ ├── .obsidian/ vault config (ignores Jekyll machinery dirs)
│ ├── _data/ THEME DATA — navigation/, ui-text, authors, ...
│ │ (Jekyll never loads _data from a theme)
│ ├── _includes/ local include overrides — bug-fix forks of two
│ │ theme partials (Liquid allowed HERE only;
│ │ no local _layouts/, all layout names resolve
│ │ into the theme)
│ └── assets/ css/js/images — css/user-overrides.css is the
│ theme's custom-CSS hook (loaded after theme CSS)
├── _config.yml Jekyll config (source: pages, destination: _site)
├── .theme-overrides.yml declares the two intentional theme-partial forks
│ (read by the theme's scripts/bin/audit-consumer)
├── .github/workflows/ pages.yml build + deploy to GitHub Pages
│ ci.yml thin caller of the shared
│ bamr87/bamr87 standard-ci.yml
│ schema-check.yml SCHEMA.md pyramid lint
│ markdown-oneline.yml one-paragraph-per-line gate
│ claude.yml @claude mention handler
└── PRD.md product requirements (vision)
Content scope is deliberately narrow: _docs/, _posts/, and _notes/ only, plus their MOC dashboards and the index pages at the vault root (index.md, posts.md, notes.md, archives.md, categories.md, tags.md). Do not add new collections without updating this contract.
Content flow¶
- Author — the claude-obsidian skills are THE content-creation path:
/wiki-ingestfiles sources dropped inpages/.raw/into structured notes,/savecaptures a conversation or insight,/autoresearchruns a research loop and files its findings,/wiki-queryanswers from the vault (and files good answers back). A human editing the vault in Obsidian works too — same rules apply. - Bridge — on push to
main, CI builds the site with zer0-CMS's Jekyll-theme option:tools/obsidian/(Python, at the repository root) converts wikilinks, callouts, and Dataview fences to HTML in an exported copy of the vault before a plugin-less Jekyll build (source files are never rewritten) and generates the graph index JSON. The site's Ruby plugins (pages/_plugins/) did this inside the build until it moved to the option (PLAN P-D7). - Publish — the built
_sitedeploys to GitHub Pages athttps://bamr87.github.io/zer0-pages/(url: https://bamr87.github.io,baseurl: /zer0-pages). One-time manual step per repo: Settings → Pages → Build and deployment → Source: GitHub Actions — without it the first deploy fails with aGet Pages site failed404.
Theme¶
The site's UI is the zer0-mistakes theme, fetched by the Jekyll-theme option as a remote theme at the tag the site's render: setting in the root workspace.yml pins — v1.28.0, the release its former Gemfile.lock resolved. A theme release reaches the site when that tag moves, with the site's recording (web/site/fixtures/zer0-pages/) re-made and the reason said; theme bugs go upstream rather than getting pinned around. Layouts, includes, and vendored Bootstrap 5 come from the theme — the repo has no local _layouts/; every layout name (default, article, note, section, ...) resolves straight into the theme. The repo keeps exactly two local include overrides in pages/_includes/, declared in .theme-overrides.yml at the repo root so the theme's scripts/bin/audit-consumer classifies them as intentional rather than drift.
Both of the bugs these forks were originally cut for are fixed upstream. bamr87/zer0-mistakes#293 (double relative_url on preview_path) and #294 (OBSIDIAN_WIKI_INDEX_URL global-name mismatch) both shipped in theme v1.26.0 (2026-07-07) — see that release's entries in the theme's CHANGELOG.md. An earlier version of this section claimed the opposite (that both were "still present upstream as of gem v1.26.0"); that was backwards. The forks are still kept, but for the reasons below — not for those two bugs.
content/intro.html— thepreview_path/relative_urllogic in this fork is now byte-identical to the theme's, so it carries no baseurl fix any more (#293 is fixed; a build against 1.28.0 renders the hero banner asurl('/zer0-pages/assets/…'), a single baseurl segment). What the fork still does differently: (a) it keeps the "Copilot Agent" prompt dropdown driven bypages/_data/prompts.yml, which the theme replaced with its page-feedback "Improve" widget — and that widget is gated onsite.page_feedback.enabled, which this site does not set, so taking the theme's copy would leave the intro with no prompt/report button at all; (b) it predates the theme's i18n integration — no{%- include core/i18n.html -%}, noui.*lookups — so every label in the fork is hard-coded English while the theme's copy is translatable.obsidian/full-graph.html— the#294workaround (pinningwindow.OBSIDIAN_WIKI_INDEX_URLexplicitly) is redundant against 1.26.0+, whoseassets/js/obsidian-graph.jsreadswindow.OBSIDIAN_CONFIG.wikiIndexUrlfirst and only falls back to the legacy global. It is harmless (it sets the same baseurl-correct URL the fallback would use) and is left in place. The real reason this fork still exists is that it is frozen at a pre-1.26 snapshot of the theme's graph page: the theme has since redesigned that page entirely — a collapsible "Graph settings" panel (Filters / Display / Forces accordion), per-collection toggles with counts that double as the legend, an unresolved-links switch, node-size / link-thickness / label-fade sliders, repulsion / link-distance sliders with animated re-layout, a vertical zoom-in/out/fit/fullscreen button group, a hover preview card,tag:andpath:search operators, and localStorage-persisted settings. The fork has none of it: just a flat toolbar (search + Reset view + orphans switch), a static legend, and its own scoped<style>block (the theme styles this from_sass/core/_obsidian.scss). It also drops the theme's H1/intro and its "See also" wikilinks — which point at theme-only pages that do not exist in this vault — and credits the localpages/_plugins/obsidian_graph_index.rbin "How it's built" — a file deleted when the site moved to the Jekyll-theme option (the generator is nowtools/obsidian/graph_index.py); correcting the include is a content change with a re-recording.
Retiring either fork is a real change, not a cleanup. Dropping content/intro.html trades the Copilot dropdown for a button this site has disabled; dropping obsidian/full-graph.html gains the redesigned graph UI but re-introduces five broken wikilinks and a "How it's built" table that credits the theme's Liquid template instead of this repo's generator. Do neither without building and eyeballing the rendered pages.
- Data files are ours to provide. Jekyll never loads
_datafrom a theme, so every data file the theme reads lives inpages/_data/: site navigation inpages/_data/navigation/*.yml, plusui-text.yml,authors.yml,theme_skins.yml,theme_backgrounds.yml, and structured stubs forcontent_statistics.yml/features.yml. - Custom CSS hook.
_config.ymlsetsuser_overrides: true, so the theme loadspages/assets/css/user-overrides.cssLAST (after its own CSS) — bridge styling (Dataview tables, callouts, unresolved-wikilink flags) lives there. - The theme repo's own
obsidian_links.rbis intentionally NOT used: plugins never load from a theme, and it resolves wikilinks by title while this vault's links are path-qualified — copying it in would double-convert. The Python bridge (zer0-CMS'stools/obsidian/) is the sole Obsidian→HTML converter. - Theme development: change the theme in
bamr87/zer0-mistakesand pick up the release by moving this site'srender:tag. Never patch around an upstream bug here.
Obsidian graph UI¶
The site ships an interactive vault graph (theme feature, enabled end-to-end):
- Data —
tools/obsidian/graph_index.py(run by the Jekyll-theme option on the exported vault, before the build) walks the same document pool as the bridge, extracts each doc's outgoing wikilinks (reusing the bridge's parser and fence-masking — never duplicate that logic), and emits/assets/data/wiki-index.json({generated_at, count, entries[]}; entry = title/basename/url/collection/tags/categories/aliases/outgoing/excerpt). This local synthetic page overrides the theme's own Liquid template for the same path — the theme template must NOT win, because it parses wikilinks at render time, after the bridge has already rewritten them. - UI — the theme's
js-cdn.html(included by the gem's layout chain) setswindow.OBSIDIAN_CONFIGand loads the gem'sassets/js/obsidian-graph.js+ vendored Cytoscape, which fetch the JSON and render the graph. The theme treats this as on unlessobsidian.enabled == false;_config.ymlpinsobsidian: { enabled: true }explicitly. Unresolved link targets render as red "broken" nodes — that is a feature, not a bug; fix the dead wikilink, not the graph. - Page — the graph lives at
/docs/obsidian/graph/(pages/_docs/obsidian/graph.md), whose body is a short intro plus{% include obsidian/full-graph.html %}. That file is the ONE content file withrender_with_liquid: true(the include is Liquid). The include itself is a local override atpages/_includes/obsidian/full-graph.html, trimmed of theme-repo-only links. - Backlinks — the theme's
notelayout includes a client-side backlinks panel that consumes the samewiki-index.json, so notes show "linked from" for free.
Dual-compatibility rules — ALL new content¶
- Frontmatter (flat YAML): every file must carry
title,type, anddescription. Give each page apermalink:and mirror it inaliases:(aliases carry old/canonical URLs so wikilinks and historic links resolve). Collections also apply pattern permalinks (/docs/:path/,/notes/:path/) — an explicitpermalink:in frontmatter always wins._posts/is the exception: it is Jekyll's built-in posts collection, not a custom one, so it has no entry undercollections:in_config.ymland instead uses the sitewidepermalink: prettydate-based scheme — individual post files do not need an explicitpermalink:/aliases:pair unless their URL needs to diverge from that default (the sevenNNNN-01-01-index.mdcategory-index pages under_posts/<category>/are the diverging case, and do carry explicit permalinks). - Wikilinks are fine and preferred:
[[path/from/vault-root|Display]]— path-qualified from the vault root, no.mdextension. The bridge resolves them to URLs; unresolved links render as a flagged<span>(and as red nodes in the graph). - Callouts: both
> [!NOTE]and> [!note] Titlestyles convert to Bootstrap alerts. - NO Liquid in content, ever.
render_with_liquid: falseis defaulted for all content;{% %}/{{ }}will appear literally. Liquid belongs only inpages/_layouts/andpages/_includes/. The sole exception ispages/_docs/obsidian/graph.md, which opts in withrender_with_liquid: truefor its single include line. Docs that teach Liquid keep examples inside code fences (the bridge skips fences). - Dataview fences are supported ONLY within this grammar (anything outside it falls
back to a plain link list) — authoritative spec: the header comment of zer0-CMS's
tools/obsidian/dataview.py: - Mode:
TABLE <col>[, <col>...]orLIST [<expr>]; col :=expr [AS label] FROM "folder" [OR "folder"...]orFROM "" AND -"excluded" [AND -"..."](e.g."_docs","_docs/features","wiki")- Optional
WHERE clause [AND clause...]; clause :=expr [=|!= expr]or a truthyexpr - Optional
FLATTEN expr AS alias(repeatable),GROUP BY expr [AS alias],SORT key [ASC|DESC][, key ...],LIMIT n - expr :=
field.path|"literal"| number |true|false|null| fn(args) with fnslength,default,choice,dateformat,regexreplace,lower,upper; file fieldsfile.name/file.folder/file.link/file.path;rows.<path>after GROUP BY
Build & test¶
- Unit tests (Python with PyYAML, from the zer0-CMS repository root):
python3 -m unittest tools/tests/test_obsidian_bridge.py tools/tests/test_graph_index.py tools/tests/test_obsidian_vault.py— the bridge, the graph index and the vault reader, ported test for test from the site's former Ruby suites. - Local site build (Docker; no Ruby), from the repository root:
bin/zer0 run build zer0-pages—tools/jekyll_theme.pyexports the vault, resolves it and builds it with the jekyll-4 server intosites/zer0-pages/_site/. - CI — this site lives in the zer0-CMS monorepo at
sites/zer0-pages/, and only the root.github/workflows/runs (see the rootdocs/MONOREPO.md). The rootzer0-pages.ymlgates every pull request touching this tree or what builds it: the bridge's Python tests,python3 tools/schema_lint.py check .(errors gate; warnings only log), and the site's build through the Jekyll-theme option;pages.ymlbuilds it at its route and fails a pull request whose build differs from its recording (web/site/fixtures/zer0-pages/manifest.json). The rootmarkdown-oneline.ymlandclaude.ymlcover the prose gate and@claudementions repo-wide..github/workflows/pages.ymlhere is the deploy, which does not run from the monorepo yet: the site is still published from the originalbamr87/zer0-pagesrepository.bin/zer0 run check zer0-pagesfrom the repository root runs the same tests locally.
More detail¶
- Vault-level conventions (wiki index/log/hot, ingest workflow, MOCs):
pages/AGENTS.md. - Product vision:
PRD.md. - Do not modify
claude-obsidian/(submodule) or.backups/.
SCHEMA.md protocol (Pyramid Schema)¶
This repository is structured by SCHEMA.md files — one per directory, each a lintable contract describing its own contents, one level deep. They are your primary source of structural truth. Prefer reading the schema chain over running ls -R / find to understand layout.
Orient. At the start of work, read ./SCHEMA.md. Before touching any directory, read its SCHEMA.md and, if placement is in question, the chain of schemas from root down to it. ## Conventions inherit from ancestors; the nearest schema wins.
Follow. Place and name new files according to ## Placement and ## Structure in the nearest schema. If nothing routes your file, do not guess: add a row to the appropriate Structure table (and a Placement route if it will recur), then create the file. Respect ## Forbidden. Never hand-edit entries marked generated. Never descend into directories marked terminal.
Propagate. Creating a directory is one atomic act with three parts:
1. Create the directory.
2. Create its SCHEMA.md from templates/SCHEMA.template.md, filling every placeholder — especially the one-line purpose.
3. Register it in the parent directory's Structure table.
Never leave a new directory schemaless.
Maintain. Any add / remove / rename updates the local SCHEMA.md in the same commit as the change itself. Schema edits ride with the work they describe. If you find drift you didn't cause, fix it and note it.
Verify. Before declaring a task done, run:
Fix errors. Surface warnings to the user with a one-line explanation each if you choose not to fix them.