summaryrefslogtreecommitdiff
path: root/new.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-07-21 11:12:52 +0200
committerdavidovski <david@davidovski.xyz>2023-08-09 02:42:03 +0100
commitff191a38f94d95000c227e86def4282ff41b1ae4 (patch)
tree079efc807573d21c2d5d7f6cacffa481fcc69fda /new.sh
parentf298c481fd08b58a26e17b1c36ced8128440dbf7 (diff)
add build and new scripts
Diffstat (limited to 'new.sh')
-rw-r--r--new.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/new.sh b/new.sh
new file mode 100644
index 0000000..2493cff
--- /dev/null
+++ b/new.sh
@@ -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