add build and new scripts

This commit is contained in:
davidovski 2023-07-21 11:12:52 +02:00
parent a85890b3e6
commit 4af1486a3b
2 changed files with 19 additions and 0 deletions

6
build.sh Normal file
View file

@ -0,0 +1,6 @@
#!/bin/sh
[ -d dist ] && rm -r dist
mkdir dist
shblg -i site -o dist

13
new.sh Normal file
View file

@ -0,0 +1,13 @@
#!/bin/sh
EDITOR=nvim
TEMPFILE=/tmp/blog_entry.md
$EDITOR $TEMPFILE
NAME=site/entries/$(head -1 $TEMPFILE | cut -d" " -f2- | tr " " "-" | tr "[:upper:]" "[:lower:]").html
cp $TEMPFILE "$NAME"
rm $TEMPFILE
chmod +x $NAME