Ledger: bundle htmx into main.js #43

Closed
opened 2026-10-03 11:00:55 +02:00 by Augspies · 0 comments
Owner

Part of: Ledger Redesign — spec §7 · final approach: django-htmx's {% htmx_script %} static include (same pattern as the expatgibs project — htmx served as a vendored static file, no npm package, no bundler)

Goal: Make htmx available site-wide via the django-htmx template tag.

Files: virtual_attorney/templates/base.html, virtual_attorney/settings/base.py

Acceptance:

  • {% load django_htmx %} + {% htmx_script %} in base.html head, before main.js
  • django_htmx added to INSTALLED_APPS (the tag library requires it — the middleware alone was already installed)
  • No htmx in the main.js bundle (Alpine only, 111k) — the earlier htmx.org npm/bundle approach was reverted
  • htmx.min.js + django-htmx.js static files serve 200 under /static/django_htmx/
  • No CDN script tags in templates
  • collectstatic picks up the django_htmx static files in the deploy image (verify on staging)

Notes: django_htmx middleware + {% htmx_script %} are the expatgibs-proven pattern. Verified end-to-end on the local dev server.

**Part of:** Ledger Redesign — spec §7 · final approach: django-htmx's `{% htmx_script %}` static include (same pattern as the expatgibs project — htmx served as a vendored static file, no npm package, no bundler) **Goal:** Make htmx available site-wide via the django-htmx template tag. **Files:** `virtual_attorney/templates/base.html`, `virtual_attorney/settings/base.py` **Acceptance:** - [x] `{% load django_htmx %}` + `{% htmx_script %}` in `base.html` head, before `main.js` - [x] `django_htmx` added to INSTALLED_APPS (the tag library requires it — the middleware alone was already installed) - [x] No htmx in the `main.js` bundle (Alpine only, 111k) — the earlier `htmx.org` npm/bundle approach was reverted - [x] `htmx.min.js` + `django-htmx.js` static files serve 200 under `/static/django_htmx/` - [x] No CDN script tags in templates - [ ] `collectstatic` picks up the django_htmx static files in the deploy image (verify on staging) **Notes:** `django_htmx` middleware + `{% htmx_script %}` are the expatgibs-proven pattern. Verified end-to-end on the local dev server.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Augspies/virtual-attorney#43
No description provided.