~huyngo/huyngo.srht.site

ref: 8a485b6ba516b177c5b37ad6e25fd0619f422986 huyngo.srht.site/newpost.sh -rwxr-xr-x 482 bytes
8a485b6bNgô Ngọc Đức Huy Quick fix 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
printf "Blog title: "
read title
printf "Tags: "
read tags
printf "Categories: "
read categories
printf "Ref: "
read ref
name="_posts/$(date -I)-${ref}.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 "lang: en" >>"$name"
echo "ref:    $ref" >>"$name"
echo "---" >> "$name"
vim $name