about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNgô Ngọc Đức Huy <huyngo@disroot.org>2021-02-08 21:41:00 +0700
committerNgô Ngọc Đức Huy <huyngo@disroot.org>2021-02-08 21:43:20 +0700
commita95b94189c6d9ca46f5a1b165d4b179a8abc3458 (patch)
tree09e3d837de48f6ef1e4b0e1e98478682265b3410
parent6c114758de3fc9c8d7699b35c56daf78785be7b4 (diff)
downloadblog-a95b94189c6d9ca46f5a1b165d4b179a8abc3458.tar.gz
Update post creation script
-rwxr-xr-xnewpost.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/newpost.sh b/newpost.sh
index a30aafd..cc1025b 100755
--- a/newpost.sh
+++ b/newpost.sh
@@ -4,8 +4,9 @@ printf "Tags: "
 read tags
 printf "Categories: "
 read categories
-name="_posts/$(date -I)-${title,,}"
-name=${name// /-}.md
+printf "Ref: "
+read ref
+name="_posts/$(date -I)-${ref}.md"
 _date=$(date "+%Y-%m-%d %T %z")
 echo $name
 echo "---" > "$name"
@@ -14,5 +15,7 @@ echo "title:  \"$title\"" >> "$name"
 echo "date:   $_date" >> "$name"
 echo "tags:   $tags" >> "$name"
 echo "categories: $categories" >>"$name"
+echo "lang: en" >>"$name"
+echo "ref:    $ref" >>"$name"
 echo "---" >> "$name"
 vim $name