Letterpress is a minimal, Markdown based blogging system written in Python.
#Arch Linux Installation
Install required dependancies, save blog template files to ~/Documents/letterpress and save the letterpress.py file to /usr/local/bin.
pacman -S python-pyinotify python-pygments python-markdown
mkdir ~/Documents/letterpress
cd ~/git
git clone https://github.com/meskarune/Letterpress.git
cp ~/git/Letterpress.git/press/* ~/Documents/letterpress
cp ~/git/Letterpress.git/code/letterpress.py /usr/local/bin/letterpress.py
Edit the configuration file in ~/Documents/letterpress/letterpress.conf
###Systemd Unit File:
[Unit]
Description=Letterpress Blog Post Listener
[Service]
ExecStart=/usr/bin/python /usr/local/bin/letterpress.py /home/meskarune/Documents/letterpress
[Install]
WantedBy=multi-user.target
After launch, Letterpress monitors Markdown files(recognized by the filename extension specified in letterpress.config
) in press_folder. When an new Markdown file is detected Letterpress generates a new HTML file from that Markdown file. Similarly, when an existing Markdown file is updated or deleted, Letterpress updates or deletes the corresponding HTML file.
Letterpress also monitors templates. If any change is detected in any of the template files, Letterpress rebuilds the whole site.
Letterpress also monitors subfolders and other files in press_folder but treat them as assets. It maps them directly into site_dir
. It means if you make an assets folder and put images there you can reference them in your posts, e.g., 
.
Letterpress builds these indices automatically:
- Home index
- Archive indices
- Monthly indices
- Yearly indices
- Tag indices
Letterpress writes logs into press_folder so you can easily review what is going on.
You write posts in such a natural format:
title: Post Title
date: Publishing date in the format specified in letterpress.config. The default format is 01/31/2013.
excerpt: Summary of the post.
tags: math, web
Content of the post…
### Let's have fun with math & physics
$E=m*c^2$
Refer to press/sample_post.md
for a complete example.
The recommended naming scheme for post files is to use post title, directly or shortened. Adding date to file names would result in redundant path segment in permalinks since Letterpress already puts the HTML files under folders named after their publish dates.
-
Letterpress originally created by An0
-
Templates and style sheets are derived from Michiel de Graaf's blog.
-
pyinotify by Sebastien Martini.
-
python-markdown2 by Trent Mick. My fork is used here because:
- Some necessary bug fixes are not merged back yet.
- Some extension is required to support ASCIIMathML embedding.
- I want to use my inline-styled footnotes.
-
Pygments by Pocoo.
-
MathJax for ASCIIMathML processing and MathML rendering.
So I hardly did any thing but glue these awesome things together.