From 4d0bd914e7c1ee65f4036e60149a7b891906a5d3 Mon Sep 17 00:00:00 2001 From: George Abbott Date: Tue, 31 Oct 2023 17:54:07 +0000 Subject: Commit all to date. --- web/mkblog | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 web/mkblog (limited to 'web/mkblog') diff --git a/web/mkblog b/web/mkblog new file mode 100755 index 0000000..ea91535 --- /dev/null +++ b/web/mkblog @@ -0,0 +1,22 @@ +#!/bin/sh +# Make a blog entry. Either a new entry, or edit an existing entry. + + +TEMPLATE="$BLOG_PATH/template.html" +ENTRIES_DIR="$BLOG_PATH/entries" +FILE="$ENTRIES_DIR/$1.html" + +# Handle if no parameters passed. # +if [ -z "$1" ] ; then + nvim "$ENTRIES_DIR" + exit 0 +fi + +# If parameter passed. # +if [ ! -f "$FILE" ] ; then + # We have a new blog entry. Copy template and edit that. + cp "$TEMPLATE" "$FILE" + nvim "$FILE" +else + nvim "$FILE" +fi -- cgit v1.2.1