davidovski/new.sh

14 lines
225 B
Bash
Raw Normal View History

2023-07-21 09:12:52 +00:00
#!/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