aboutsummaryrefslogtreecommitdiff
path: root/bin/new
diff options
context:
space:
mode:
Diffstat (limited to 'bin/new')
-rwxr-xr-xbin/new12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/new b/bin/new
new file mode 100755
index 0000000..825d966
--- /dev/null
+++ b/bin/new
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+# script to generate new sites and projects
+
+if [ "$1" = 'post' ]; then
+ DATE=$(date +%Y-%m-%d)
+ exec hugo new --editor $EDITOR posts/"$DATE"-"$2".md
+elif [ "$2" = 'project' ]; then
+ exec hugo new --editor $EDITOR projects/"$2".md
+else
+ echo "unknown type: $1"
+fi