From 61a584c8b855e0028788e788fa082d6d9b61a798 Mon Sep 17 00:00:00 2001 From: Huy-Ngo Date: Sun, 10 Jan 2021 20:41:57 +0700 Subject: Add script for adding new posts --- newpost.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 newpost.sh diff --git a/newpost.sh b/newpost.sh new file mode 100755 index 0000000..7918999 --- /dev/null +++ b/newpost.sh @@ -0,0 +1,16 @@ +printf "Blog title: " +read title +printf "Tags: " +read tags +printf "Categories: " +read categories +name="_posts/$(date -I)-${title,,}" +name=${name/ /-}.md +_date=$(date "+%Y-%m-%d %T %z") +echo "---" >> $name +echo "layout: post" >> $name +echo "title: \"$title\"" >> $name +echo "date: $_date" >> $name +echo "tags: $tags" >> $name +echo "categories: $categories" >>$name +echo "---" >> $name -- cgit 1.4.1