aboutsummaryrefslogtreecommitdiff
path: root/bin/new
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2021-10-15 21:59:58 -0400
committerPaul Duncan <pabs@pablotron.org>2021-10-15 21:59:58 -0400
commitd93f5d61b626805fc9fd17ba698f46c8a0c6bb18 (patch)
tree544bda5abe24a39d67934eaa83d0ef4be0afd196 /bin/new
parent5db60204cc051b40c7be897ad9995f1f553ab18d (diff)
downloadpablotron.org-d93f5d61b626805fc9fd17ba698f46c8a0c6bb18.tar.bz2
pablotron.org-d93f5d61b626805fc9fd17ba698f46c8a0c6bb18.zip
bin/new: fix post, add article, add documentation
Diffstat (limited to 'bin/new')
-rwxr-xr-xbin/new18
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/new b/bin/new
index 825d966..e6d176c 100755
--- a/bin/new
+++ b/bin/new
@@ -1,12 +1,26 @@
#!/bin/bash
-# script to generate new sites and projects
+#
+# generate new content
+#
+# Examples:
+# # create new post with slug "great-news" and title "Great News"
+# bin/new post great-news
+#
+# # create new article with slug "some-stuff" and title "Some Stuff"
+# bin/new article some-stuff
+#
+# # create new project with slug "cool-app" and title "Cool App"
+# bin/new project cool-app
+#
if [ "$1" = 'post' ]; then
DATE=$(date +%Y-%m-%d)
exec hugo new --editor $EDITOR posts/"$DATE"-"$2".md
-elif [ "$2" = 'project' ]; then
+elif [ "$1" = 'project' ]; then
exec hugo new --editor $EDITOR projects/"$2".md
+elif [ "$1" = 'article' ]; then
+ exec hugo new --editor $EDITOR articles/"$2".md
else
echo "unknown type: $1"
fi