A minimal static blog engine written in Zsh. This script generates blog pages from plain text files under the data/ directory, using simple HTML templates.
- Pure Zsh implementation (no external dependencies)
- Blog entries are just text files (1st line: title, rest: body)
- Supports nested directories for organizing posts
- Simple template system using
head.html,story.html, andfoot.html - Filters posts by
PATH_INFO(for CGI or static generation) - Sorts posts by modification time (newest first)
blosxom.zsh
head.html
story.html
foot.html
data/
first.txt
second.txt
2024/12/last-year.txt
examples/hello.txt
tips/zsh-tips.txt
- Collects posts: Recursively finds all
*.txtfiles underdata/, sorts by modification time. - Parses posts: Each file's first line is the title, the rest is the body.
- Renders templates: Fills variables into the HTML templates for head, each story, and foot.
- PATH_INFO filtering: If
PATH_INFOis set, only matching posts are shown.
head.html: Blog header (receives variables liketitle,home)story.html: Each post (receives variables liketitle,body,date,name, etc.)foot.html: Blog footer (receives variables likeversion)
First Post
This is the very first post on my blosxom.zsh blog.
Welcome to the world of Zsh blogging!
This script is designed to work as a CGI program (for example, with Apache or nginx + fcgiwrap), so it reads environment variables such as PATH_INFO and outputs the result to standard output. You can also use it to generate static HTML files.
You can easily test this script as a CGI program using Python 3:
cd cgi-bin
python3 -m http.server --cgi 8000Then access: http://localhost:8000/cgi-bin/blosxom.zsh
Note: This is for local testing and demonstration purposes only.
zsh blosxom.zsh > index.htmlOr deploy as a CGI script with a web server that supports Zsh CGI.
This is a "toy" or "joke" script for fun and demonstration purposes. Not intended for production use.
MIT