Command line boilerplate template for posts

A quick and dirty post template generator I made for myself to save a little time on boilerplate. Quick an dirty inasmuch as there is little input checking and a person could DoS the system by using /dev/zero or similar as an input filename. Currently not at all suitable for a situation where a person cannot implicitly trust users. Shared in case it saves someone time, the code is logically structured but not entirely efficient. The basic usage is:

$ cd my_site/content
$ mkdir mynewpost
$ cd mynewpost
$ mkdir images
(copy images to the images folder)
$ generaltemplate > index.md

I’m using the, excellent, Abridge Theme for something so it’s targeted at that but the program should be easily adapted to any other themes. I’ve uploaded the code here, with more details:

1 Like

I fixed the problem with /dev/zero.