Simple plant tracker built using Axum, HTMX and Pico CSS.
 
 
 
Go to file
Jef Roosens b17c2e7df6
feat: migrate /images page to new typed methods
2025-01-26 15:46:53 +01:00
migrations feat: implement thumbnail processing for image uploads 2025-01-17 11:57:36 +01:00
src feat: migrate /images page to new typed methods 2025-01-26 15:46:53 +01:00
static feat: add picocss styling 2025-01-10 15:58:58 +01:00
templates feat: migrate /images page to new typed methods 2025-01-26 15:46:53 +01:00
.dockerignore feat: implement infinite scroll on /plants page 2025-01-25 11:08:53 +01:00
.env feat: add diesel setup to project 2025-01-13 13:06:36 +01:00
.gitignore feat: switched to clap for CLI 2025-01-12 09:50:46 +01:00
Cargo.lock feat: implement infinite scroll on /plants page 2025-01-25 11:08:53 +01:00
Cargo.toml feat: implement infinite scroll on /plants page 2025-01-25 11:08:53 +01:00
Dockerfile feat: support proper arm64 docker cross compilation using zig-cc 2025-01-12 23:08:03 +01:00
README.md feat: overhaul templating system 2025-01-10 15:16:01 +01:00
diesel.toml feat: migrated all models to diesel 2025-01-16 13:01:27 +01:00

README.md

Calathea

Templates and rendering

Calathea uses the Tera templating engine. To combine Tera and HTMX, the template directory has the following structure:

  • components contains components used to build views. Components are defined as Tera macros.
  • views contains view templates that make use of the components.
  • updates are templates returned from e.g. POST requests. Tbey usually directly wrap a component, e.g. a plant li item.
  • base.html defines the skeleton for each page. Each view is rendered with this as its surrounding HTML.

When a page is requested from the server, it inspects the HX-Request and HX-History-Restore-Request headers to determine whether a full page should be returned or only the inner view. Using this, the server cn support direct routing to pages and caching properly while still supporting partial rendering using HTMX.