commit 71dfdd8f935a8cdace527518448167db29d47d1b
parent 49b586dd542ba56ffc941d1bbb876771f39e6e0e
Author: Willem Van Zwol <willem@vanzwol.com>
Date: Tue, 12 May 2026 14:38:51 -0700
Automated creating stagit pages
The README explains how to use the new flake.nix to generate the stagit
pages when making changes. The index.html's git icon in the top-right
corner also now links to show the stagit log.html file. Renamed project
from willem.vanzwol.com to generic "website", plan is for other repos to
be stored in git/
Diffstat:
4 files changed, 84 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
@@ -1,3 +1,11 @@
-# willem.vanzwol.com
+# Website (willem.vanzwol.com)
-Testing out the readme with stagit
+For now this site is very bland. This README will likely serve to document and/or roadmap. Honestly I'm not sure yet. But I do have stagit setup in a way I like now. Just run:
+
+```bash
+nix run
+```
+
+and that generates the stagit in git/website/ via the writeShellApplication in `flake.nix`
+
+There is a lot more that I want to do with this though, this is not finished.
diff --git a/flake.lock b/flake.lock
@@ -0,0 +1,27 @@
+{
+ "nodes": {
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1778443072,
+ "narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "da5ad661ba4e5ef59ba743f0d112cbc30e474f32",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "ref": "nixos-unstable",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "nixpkgs": "nixpkgs"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
@@ -0,0 +1,46 @@
+{
+ description = "stagit site generator";
+
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+
+ outputs = { self, nixpkgs }:
+ let
+ system = "x86_64-linux";
+ pkgs = import nixpkgs { inherit system; };
+ in {
+ packages.${system}.stagit-run = pkgs.writeShellApplication {
+ name = "stagit-run";
+ runtimeInputs = [ pkgs.stagit pkgs.git ];
+
+ text = ''
+set -euo pipefail
+
+REPO="$(pwd)"
+OUT="$REPO/git/website"
+
+rm -rf "$OUT"
+mkdir -p "$OUT"
+
+tmp="$(mktemp -d)"
+
+# run inside output dir (important)
+cd "$tmp"
+
+stagit -c cache "$REPO"
+
+cp -r ./* "$OUT"
+
+ln -sf "${pkgs.stagit}/share/doc/stagit/style.css" "$OUT/style.css"
+ln -sf "${pkgs.stagit}/share/doc/stagit/logo.png" "$OUT/logo.png"
+ln -sf "${pkgs.stagit}/share/doc/stagit/favicon.png" "$OUT/favicon.png"
+
+echo "generated: $OUT"
+ '';
+ };
+
+ apps.${system}.default = {
+ type = "app";
+ program = "${self.packages.${system}.stagit-run}/bin/stagit-run";
+ };
+ };
+}
diff --git a/index.html b/index.html
@@ -23,7 +23,7 @@
<!-- RIGHT -->
<div class="nav-right">
- <a href="">
+ <a href="./git/website/log.html">
<!-- giticon -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" style="width: 0.85em; position: relative; top: 0.06em; fill: var(--text)">
<path d="M15,5.6,10.4,1A3.4,3.4,0,0,0,5.78.86L7.66,2.74a1.25,1.25,0,0,1,1.67,1.2V4a1.23,1.23,0,0,1-.08.38l2.45,2.4a1.17,1.17,0,0,1,.37-.08A1.3,1.3,0,1,1,10.77,8h0a1.17,1.17,0,0,1,.08-.37L8.6,5.38v5.23a1.28,1.28,0,0,1,.73,1.15,1.3,1.3,0,0,1-2.6,0,1.27,1.27,0,0,1,.67-1.11V5.07A1.27,1.27,0,0,1,6.73,4a1.17,1.17,0,0,1,.08-.37l-1.9-1.9L1,5.6a3.38,3.38,0,0,0,0,4.79H1L5.6,15a3.38,3.38,0,0,0,4.79,0h0L15,10.4a3.38,3.38,0,0,0,0-4.79Z"/>