No description
  • Nunjucks 57.4%
  • JavaScript 25.7%
  • Shell 15%
  • Nix 1.9%
Find a file
2025-09-20 22:18:26 +02:00
scripts fix power-history script, pmOS ships with multiple logreads 2024-11-28 11:52:07 +01:00
src 2025-09-20: fix typo 2025-09-20 22:18:26 +02:00
.DS_Store cleanup of font size declarations; added global max width for layout; smaller font size for mobile viewports; introduced class for lead paragraph; 2024-11-24 15:39:32 +01:00
.eleventy.js use subset of departure mono for battery gauge 2024-11-28 01:24:27 +01:00
.eleventyignore add fonts, fix readme, all-lowercase always 2024-02-18 20:34:18 +01:00
.envrc Initial commit 2024-02-18 17:52:52 +01:00
.gitignore Initial commit 2024-02-18 17:52:52 +01:00
flake.lock Initial commit 2024-02-18 17:52:52 +01:00
flake.nix remove unused typescript dependency 2025-06-17 22:24:06 +02:00
package-lock.json bump 11ty to latest stable version 2025-07-02 12:40:19 +02:00
package.json bump 11ty to latest stable version 2025-07-02 12:40:19 +02:00
README.md document how to write maintenance log entries 2025-07-02 13:05:51 +02:00

compost.party

This is the static website for https://compost.party. It is built from a bunch of static files living in the src folder using a static site generator called Eleventy. 11ty runs on nodejs, which along with npm is a hard dependency to generate the html files:

node --version
# v18.19.0
npm --version
# 10.2.3

Other versions may work, the ones above are the ones that certainly work at the time of writing this README.

If you have the dependencies installed (you can use the flake.nix in the root of this repository if you use nix for your system packages), you can spin up alocal version of the site by running:

npm ci # install dependencies; only needs to be run once
npm run dev # start a local server to preview the page

The following command will create and fill a dist folder whose contents you can upload to any static file host:

npm run build

Battery gauge

The battery gauge works correctly only if the battery level is logged regularly:

# crontab -l
# minute hour	day	month	day-of-week	
*/15	*	*	*	*	$HOME/.local/bin/power-info | jq -c --arg t $(date '+%FT%T%z') '. + {timestamp: $t}' | logger -i --tag $LOGNAME/power-info
*/30	*	*	*	*	cd $HOME/git/compost.party && git stash && git pull --rebase && { git stash pop || true; } && ./scripts/update-data.sh && npm run build -- --output=$HOME/html/

Adding maintenance log entries

To create a new log entry, create a file named after the date of the entry in src/maintenance:

# create a log entry for today:
today="$(date +%F)"
touch "src/maintenance/$today.md"

# if you want to add images, create a folder next to it to keep things tidy:
# mkdir "src/maintenance/$today"

The log entries contain markdown, you can just start writing. They will under https://compost.party/maintenance/, the most recent will be the topmost.

Adding dithered images

The log entries can contain some front matter, which, if formatted in a certain way, can be used to add images to each log entry. The first couple of lines in entries with images look like this (taken from ./src/maintenance/2024-12-12.md):

---
images:
- src: ./2024-12-12/phone-battery-doerthe-dithered.png
  alt: Dithered photo of the server-phone on a carpet with a honeycomb-like pattern. A curly cable connects it to a battery pack, and the feet of a cat are visible tiptoeing around it.
---
Right after this you would continue to write the log entry as you normally would…

Dithering is currently done individually for each file using didder. The snippet below can be used to dither all jpeg files in a given folder:

today="$(date +%F)"
for f in $today/*.{jpg,jpeg}; do
    didder --palette '#f5f5f5 #d6d6d6 #24b400' --in "$f" --out "$(echo $f | sed -E 's|.jpe?g|-dithered.png|') --height 300 bayer 16x16
done

The resulting dithered png can often be further optimized with oxipng.