💾 Archived View for thrig.me › software › blog-engine.gmi captured on 2023-01-29 at 03:36:31. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
A description may be more useful than any code. Alternatives exist:
gemini://perso.pw/blog/articles/blog-workflow.gmi
For sqlite. To support multiple blogs I'd probably vary the database file used rather than complicating it with a site table.
CREATE TABLE blog ( id INTEGER NOT NULL PRIMARY KEY, epoch INTEGER NOT NULL, filename TEXT NOT NULL, subject TEXT NOT NULL, body TEXT NOT NULL ); CREATE INDEX blogepoch ON blog (epoch);
A CLI tool to make new, list existing, or to edit entries. At the heart is a text editor working on a temporary file; the format looks something like an email message,
Epoch 1670907653 Filename yet-another-blog-engine-rewrite Subject Yet Another Blog Engine Rewrite # Yet Another Blog Engine Rewrite ...
Known header values get put into the corresponding blog table columns, and remaining text after the header is placed into the body column.
$ blog-about yet-another-blog-engine-rewrite $ blog-about -l $ blog-about -e 30
This script converts the database contents into a static site. At present it rebuilds all postings, but that could be made more efficient. A complication is the previous and next links which requires knowing the adjacent posting (or postings) by epoch.
Then, rsync stuffs the files up onto some virt.