This post was initialised from the command line! Here’s the script I used:
#!/bin/bash
# Check the number of arguments passed
if [ "$#" -eq 1 ]; then
postname="content/microposts/$(date +'%Y-%m-%d_%H-%M-%S').md"
hugo new $postname
echo -e "\n$1" >> $postname
else
echo "Error: Multiple parameters passed. Only the first parameter is accepted."
exit 1
fi
I did append the code by hand because I’m lazy and can’t imagine wanting to do that often.