about summary refs log tree commit diff
path: root/newpost.sh
blob: d689221ca0fa672d41e308eeca3fbb12ccbb8a15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 "---" > "$name"
echo "layout: post" >> "$name"
echo "title:  \"$title\"" >> "$name"
echo "date:   $_date" >> "$name"
echo "tags:   $tags" >> "$name"
echo "categories: $categories" >>"$name"
echo "---" >> "$name"