new_post.py

Creates a new post for Hugo, change “pathy” to the posts directory. Change “diry” to the path of your Hugo site.

Checks if the URL is unique, by checking the public directory. If not, it makes a random number, and the URL is /blog/2019/11/random/title. Edit the script, if you don’t want year/month/title.

The script could be more efficient, but I’m lazy. It works, so I don’t care.

Only tested in macOS, but I’d think it would work in Linux too. Probably needs work to work in shitty OSs like Windows.

Usage

./new_post.py post-name

Download

0.1