Manual
Almnck.
Price: 50ⓐ

Editorial Pipeline Design

Date: 2026-01-02

Overview

A publishing pipeline where git is the source of truth, Django provides a web view and admin interface, and the output is a static site deployed to multiple VPSs.

Core Principles

  1. Git is the database — All content lives in the repo under editorial/
  2. Django is a cache — The database mirrors the repo; changes sync back to files
  3. CLI-first — Makefile is the primary interface; Django commands underneath
  4. Explicit commits — Edits are staged; committing is a deliberate action
  5. Directory-per-unit — Each publishable unit (article, page, banner) is a self-contained directory

Repository Structure

almnck/
├── editorial/                    # All publishable content
│   ├── articles/
│   │   └── look-back-up/
│   │       ├── article.md        # Content + YAML frontmatter
│   │       ├── editorial/        # Pass notes (STYLE.md, FACTS.md, etc.)
│   │       └── assets/           # Article-specific assets
│   ├── pages/
│   │   ├── about/
│   │   └── finances/
│   ├── banners/
│   └── front-page/
│
├── src/almnck/                   # Django project
├── web/                          # Static output (generated, never edited)
├── doc/                          # Internal documentation
├── llc/                          # Corporate records, accounting
└── secrets/                      # Symlinked, not in repo

Unit Structure

Each unit is a directory containing:

  • Main content file (article.md, page.md, etc.) with YAML frontmatter
  • assets/ subdirectory for images, scripts, SVGs, audio, video
  • editorial/ subdirectory for pass notes (format TBD, likely patch-with-commentary)

Frontmatter Example (Article)

---
title: "Look Back Up"
day: apr-02
path: /apr/02/look-back-up/
status: draft
author: contributor-name
---

Frontmatter Example (Front Page)

---
type: page
path: /
template: front-page.html
---

{% latest_articles count=5 %}
{% featured_banner %}

Django Architecture

src/almnck/
├── manage.py
├── almnck/
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
│
├── units/                        # Main app
│   ├── models.py                 # Unit model
│   ├── admin.py                  # Admin interface
│   ├── sync.py                   # Git <-> DB sync
│   ├── views.py                  # Views for distill
│   └── distill.py                # Static generation URLs
│
└── templates/
    ├── base.html                 # Site chrome
    ├── article.html
    ├── front-page.html
    └── components/               # htmx fragments (future)

Unit Model

class Unit(models.Model):
    path = models.CharField()          # e.g., "articles/look-back-up"
    output_path = models.CharField()   # e.g., "/apr/02/look-back-up/"
    unit_type = models.CharField()     # article, page, banner
    title = models.CharField()
    status = models.CharField()        # draft, editing, published
    content = models.TextField()       # Markdown body
    frontmatter = models.JSONField()   # All YAML frontmatter
    file_hash = models.CharField()     # For detecting external changes

Sync Behavior

  • sync-with-repo: Scans editorial/, updates DB from files
  • Admin edits write back to files (staged, not committed)
  • commit-changes: Commits staged changes to git
  • Sync is hybrid: on-demand primary, with git hooks for external changes

CLI Interface

# Makefile (primary interface)

sync-django:                 # Git -> Django DB
    ./manage.py sync-with-repo

build-django-site:           # Django DB -> web/
    ./manage.py build-with-distill

live:                        # rsync to VPSs
    # existing logic

editorial-status:            # Show units and states (standalone)
    bin/editorial-status

editorial-doctor:            # Validate structure (standalone)
    bin/editorial-doctor

editorial-commit:            # Commit staged changes
    git add editorial/ && git commit -m "$(MSG)"

Tool Responsibilities

Task Tool Rationale
Sync repo to DB Django Needs ORM
Edit content Django admin Web convenience
Build static site Django + distill Needs templates
Status overview bin/editorial-status Parses files, no DB
Validate structure bin/editorial-doctor Standalone, LLM-friendly
Commit changes git No Django needed

Static Output

web/
├── index.html                    # front-page
├── about/index.html
├── apr/
│   └── 02/
│       └── look-back-up/
│           └── index.html
├── static/                       # CSS, shared JS
└── assets/                       # Copied from unit assets/

Output paths are defined by each unit’s path frontmatter. Articles use calendar-day paths (e.g., /apr/02/).

Future: Multi-format Output

Units may generate multiple files:

apr/02/look-back-up/
├── index.html
├── index.json
└── index.abc123.json.age    # Encrypted for user group

Deferred to Future Versions

Feature Notes
Editorial workflow (5 passes) Structure exists; LLM tooling later
Patch-with-commentary format Design with workflow layer
Encrypted content Frontmatter declares; generator later
Multiple output formats Start with HTML only
htmx interactivity Templates support it; no fragments yet
IPFS/CAR export Static output compatible; tooling later
User authentication Public-key design exists; implement later

v1 Scope

  1. Repository structure with editorial/ containing units
  2. Django app that syncs with repo and provides admin
  3. make build-django-site generates static web/
  4. make live deploys (already exists)
  5. bin/editorial-status and bin/editorial-doctor scripts

Addendum (2026-01-17): Makefile commands were reorganized. sync-django → sync, build-django-site → build, live → prod-deploy, editorial-* → ed-*.