#!/usr/bin/env bash # create text, assemble html file, add to articles #web is a symlink to /home/philip/src/web/wittamore.com ROOT=/home/philip/web mkdir -p $ROOT/.tmp cd $ROOT/.tmp || exit EDITFILE="middle.html" DATE=$(date +%Y-%m-%d) read -r -p "Enter title: " TITLE read -r -e -i "$DATE" -p "Enter date: " input read -r -p "Enter description: " DESCRIPTION ARTICLEDATE="${input:-$DATE}" YEAR=$(echo "$ARTICLEDATE" | cut -c 1-4) DEST="$ROOT/articles/$YEAR" echo "
ยง
' >> "$ARTICLE" mv "$ARTICLE" "$DEST" echo "saved as $DEST/$ARTICLE"