Blog Template Script

You may have noticed my most recent couple of posts now have a publishing date at the bottom. This was not changed manually, but rather is a part of my new script for generating blog post pages.

All I do now is type the post as a plain text file, give it a title, and run the script. This simple python script then parses the text file for paragraphs, and then generates the html page from a template. This has exponentially improved my ability to churn out posts in the future.

Yes yes, I know... I could just use blogging software like blogger or wordpress or something... but where is the fun in that? Those sorts of purpose built solutions (despite being far more robust, easy to use, secure, etc...) aren't quite as pleasing as the simplicity of a basic HTML page with some plain text. SO all that to say, here's how the script works:

The command line arguments provide a title for the post, as well as the location of the input text file and the output html file. The actual HTML template is in the script itself, but in theory it would be trivial to provide an external file for this. The script looks for new paragraphs by using double carriage returns as a delimiter, and then creates the html title and body. The date is appended to the end of the article, and poof. Blog post.

The script can be read in full at this link.

Cheers.



2026-05-16