-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew-post.sh
31 lines (28 loc) · 1.14 KB
/
new-post.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
title () {
echo ""
echo "-------------------------------------------------------------------------------------------------------------------"
echo "Insert the title of your article (you can always change it later, but remember to change the name of the file too):"
echo "-------------------------------------------------------------------------------------------------------------------"
read input3
hugo new -k docs "$1/$input3.md"
}
echo "--------------------------------------------"
echo "Please, select the category of your article:"
echo "--------------------------------------------"
select d in $(find content/ja/docs/ -maxdepth 1 ! -path content/ja/docs/images ! -path content/ja/docs/ -type d)
do
ls $d/*/ >/dev/null 2>&1;
if [ $? == 0 ]
then
echo ""
echo "------------------------------------------------"
echo "Please, select the sub-category of your article:"
echo "------------------------------------------------"
select e in $(find $d -maxdepth 1 ! -path $d -type d)
do
title $e; exit;
done
fi
title $d; exit;
done