davidovski/new.sh
2023-07-21 11:13:47 +02:00

13 lines
225 B
Bash
Executable file

#!/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