Skip to content
botBehaviorPublic

About

A local writing desk for a Zola site, built on Topcoat. hupomnēmata were notebooks kept as (Foucault, "Self Writing").

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

hypomnema

A local writing desk for a Zola site, built on Topcoat.

It runs on 127.0.0.1, edits your site's files in place, and shows the real site beside the editor as you write. Your site stays plain markdown. If you delete hypomnema, the site still builds.

Askēsis is the practice; hupomnēmata were the notebooks kept as part of it (Foucault, "Self Writing").

The desk: a sidebar of sections and pages, a post open in the editor, and the real site beside it with a live WebGPU glyph rain running inside the post

What it does

  • Desk. Sections and pages in a sidebar, front matter as form fields, the body as plain text, and a live preview that is a real zola build --drafts. Click a link in the preview and the editor opens that page. Fuzzy find (Ctrl-K), [[ to link another page, backlinks and pages nothing links to.

  • Live. Change a file anywhere (your editor, a build script, git) and the desk and preview follow without a refresh. If you're mid-edit, it tells you instead of reloading under you.

  • New. Pick a section, name the page, and see its URL as you type. New pages start as drafts.

  • Tags. Fuzzy completion inside the field from the terms you already use. → or Tab accepts.

  • Design (optional). Colour pickers and sliders for your CSS custom properties, applied to the preview as you drag. Your front page as a list of blocks you reorder, hide, duplicate and edit.

  • Publish (optional). Changed files with diffs, your site's own leak check, a commit under the identity you configure, then your deploy step: a command, or a git push for hosts that build from the repo. Drafts are never committed or published. Deleting a draft moves it to the system trash.

Edits change only what you edited: front matter round-trips byte for byte, comments and formatting included.

A tour of the desk: typing into a post and saving as the preview rebuilds beside it, starting a new post and naming it, tagging it with fuzzy completion, then reordering the front page and switching builds to three columns in the design view

Requirements

  • Rust (tested on 1.100) and cargo install cargo-topcoat, which provides the topcoat command build.sh uses
  • Zola 0.23 on your PATH
  • git, if you want the git status and publishing
  • for deploying to Cloudflare Workers: edgepub, or any command you like
  • Linux or macOS. Windows is untested.

Quick start

git clone https://github.com/botBehavior/hypomnema && cd hypomnema
cp hypomnema.example.toml hypomnema.toml   # set `site` to your Zola site
./build.sh                                 # cargo build + topcoat asset bundle
./target/release/hypomnema                 # http://127.0.0.1:3400/

Always build with ./build.sh. cargo build alone doesn't rebundle the JS and CSS, and the server will serve the old ones without a warning.

To keep it running, hypomnema.service.example is a systemd --user unit.

Configuration

hypomnema.toml, or the file named by HYPO_CONFIG:

site = "/path/to/your/zola/site"
port = 3400

[design]                         # optional
tokens = "static/tokens.css"     # CSS custom properties
layout = "data/home.toml"        # a [[block]] array your template renders
layout_url = "/"                 # the page that layout drives

[publish]                        # optional
check = "scripts/publish-check.sh"
output = "public"
author = "Your Name <you@users.noreply.github.com>"

[publish.deploy]                 # optional: what runs after the commit
command = ["edgepub", "deploy", "public", "--config", "~/.config/edgepub/site.toml"]
# or: push = "origin"            # git push origin HEAD:main

What each part expects from your site is in docs/design.md.

Security

hypomnema writes files and runs commands, so it treats the browser as hostile:

  • It binds loopback only and refuses anything else.
  • Every request must name a loopback Host (127.0.0.1, localhost, [::1]). Topcoat's origin check stops cross-site requests, but not DNS rebinding, where another site's page makes same-origin requests to your machine.
  • The preview is built with zola build and served by hypomnema behind that check. It never runs zola serve, which answers any Host and would serve your drafts to a rebinding page.

Details in docs/design.md.

Built with

Topcoat, Zola, toml_edit, nucleo, pulldown-cmark, reqwest, trash. Written with Claude Code.

If you're here for Topcoat, docs/design.md has what worked and what needed working around.

Author

botBehavior · botbehavior.dev

Licence

Apache-2.0.

About

A local writing desk for a Zola site, built on Topcoat. hupomnēmata were notebooks kept as (Foucault, "Self Writing").

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages