# Web Engine
A website generated from one file per page.
Each page has its own table of content (new since 2023-02-28).
# 1 Page Format
File has 4-line header, followed by 1 blank line, followed by content.
Header:
title
date --iso=skeywords (space separated)
description
Content is djot markup, https://djot.net.
# 2 Indices
Indices sorted by date are generated for each keyword, and everything.
For index foo, pages/_foo.djot is included
at the start.
The main index lists recent changes from everything, and lists keyword indices.
index/*.ix is used temporarily.
Each index has a corresponding RSS feed.
# 3 Bugs
Removing a keyword from a page will not update the corresponding index file, you must do that on your own.
Removing an index file will lead to inconsistency.
Removing or renaming a page will lead to inconsistency.
Modifying the script rebuilds everything (this is intentional).
The index processing is quadratic time in the number of pages.
A page named the same as an index (keyword) will be overwritten.
# 4 Source
git clone https://code.mathr.co.uk/web.git
# 5 Dependencies
sudo apt install pandocNote: this changed 2026-08-24 (previously djot.lua was used alone).
git clone https://code.mathr.co.uk/djot.lua.gitNote: next Debian stable may have a Pandoc with built in djot support, at which point this dependency can be dropped (with appropriate changes to build.sh).
Note: this changed 2026-08-24 (previously the mathr branch was needed). Upstream repository may also work fine.
Note: this changed 2023-02-27 (forked from original github repository).
Note: this changed 2023-01-02 (split from original
djot.gitrepository).
# 6 Deployment
Automatic build on git push via server’s
web.git/hooks/post-receive:
#!/bin/sh
TARGET="/path/to/work/web"
GIT_DIR="/path/to/bare/web.git"
BRANCH="main"
while read oldrev newrev ref
do
if [ "X${ref}" = "Xrefs/heads/${BRANCH}" ]
then
echo "Deploying ${ref}..."
git --work-tree="${TARGET}" --git-dir="${GIT_DIR}" checkout -f
( cd "${TARGET}" && ./build.sh )
fi
done