]> git.ardis.lu - git.ardis.lu/commitdiff
Add `README.md` renderer to `post-update` hook
authorArdis Lu <ardisglu@gmail.com>
Sun, 14 Sep 2025 23:39:13 +0000 (16:39 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 14 Sep 2025 23:39:13 +0000 (16:39 -0700)
README.md
srv/git/git-shell-commands/init

index 6f596267816bcb56f940ba1ca5b8d7e09c32ca82..f81798e2be967ff6310996805a436199a6591c48 100644 (file)
--- a/README.md
+++ b/README.md
@@ -16,12 +16,15 @@ sudo apt install git gitweb highlight ufw fcgiwrap
 
 See [Caddy: Install](https://caddyserver.com/docs/install) for directions on installing `caddy`.
 
+See [Comrak](https://github.com/kivikakk/comrak) for installing `comrak`.
+
 Explanation:
 - `git`, `gitweb` are naturally required.
 - `highlight` for code syntax highlighting on the web view.
 - `ufw` for setting up firewall rules (can substitute with whatever you like).
 - `fcgiwrap` to call the `gitweb` and `git-http-backend` FastCGI scripts.
 - `caddy` for the web server to serve the web view and repos over HTTPS.
+- `comrak` for rendering `README.md` as close to GitHub as possible.
 
 2. Clone this repo somewhere on the server.
 
index 7ed11eaafffc32e5178d0e65bb2c1dcebff70c25..3aee44a8e43fdeabb70bcfbf44cd1bffba09084e 100644 (file)
@@ -44,13 +44,15 @@ git init --bare --quiet
 # Commented out to simplify administration (not dealing with cron jobs to remove repos)
 # git maintenance start
 
-# Create post-update hook for dumb HTTP transport and general maintenance
+# Create post-update hook for dumb HTTP transport, generating README for summary view,
+# and general maintenance.
 # See https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#_dumb_http)
 # See https://git-scm.com/docs/git-maintenance
 # See https://git-scm.com/book/en/v2/Git-Internals-Maintenance-and-Data-Recovery
 cat > "$path/hooks/post-update" << EOL
 #!/bin/sh
 git update-server-info
+git cat-file blob HEAD:README.md | comrak > $GIT_DIR/README.html
 git maintenance run
 EOL
 chmod a+x "$path/hooks/post-update"
This page took 0.043324 seconds and 4 git commands to generate.