Based on the way described in a previous article, following shell script can be run to create new md file (new blog post) based on archetype.
#!/bin/sh
echo "Enter post title (.md will be automatically added)"
echo "Post title: "
read posttitle
hugo new -k post posts/$posttitle.md
running this will create a new md file in /content/posts
based on the archetype in /archetype
Create a file called new.sh
and place this .sh file in root of hugo project, and run:
- PowerShell and bash:
./new.sh