Add script for adding new posts
This commit is contained in:
parent
6e8ebe9c4b
commit
61a584c8b8
1 changed files with 16 additions and 0 deletions
16
newpost.sh
Executable file
16
newpost.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue