I wrote a script to automate blog-posting, both for use directly on devuan, and remotely (such as work).

The script is designed to do the boiler-plate stuff and make jotting down a few notes quick and easy.

#!/bin/bash

usage()
{
  echo "Usage: $0 [-p] [-c category] [-i image] [-v video] [-d desc] <title>"
  exit 1
}

start_dir=$PWD

while getopts "c:i:v:d:p" o
do
  case "${o}" in
    c)
      category=${OPTARG}
      ;;
    i)
      echo "Processing web-optimized images"
      img_dir=${OPTARG%/*}
      if [ "${img_dir:0:1}" != "/" ]
      then
        img_dir="${PWD}/${img_dir}"
      fi
      file=${OPTARG##*/}
      (
        cd ~/fresh/assets/img
        mk_srcset "$img_dir/${file}"
      )
      image=${file%%.*}
      ;;
    v)
      echo "Processing web-optimized video"
      mov_dir=${OPTARG%/*}
      if [ "${mov_dir:0:1}" != "/" ]
      then
        mov_dir="${PWD}/${mov_dir}"
      fi
      file=${OPTARG##*/}
      (
        cd ~/fresh/assets/video
        mk_video "${mov_dir}/${file}"
      )
      video=${file%%.*}
      ;;
    d)
      desc=${OPTARG}
      ;;
    p)
      post=1
      ;;
    *)
      usage
      ;;
  esac
done
shift $((OPTIND-1))

if [ $# -lt 1 ]
then
  usage
fi

dir="${HOME}/fresh/_posts"
title="${1}"
if [ -e "${dir}/"*"${title}.md" ]
then
  files=("${dir}/"*"${title}.md")
  file="${files[-1]}"
else
  date=$(date '+%F-%I:%M')
  file="${dir}/${date}-${title}.md"
fi

if [ ! -e "${file}" ]
then
  cat <<HERE > "${file}"
---
layout: post
title: ${title^}
author: ${USER}
description: ${desc}
category: ${category}
img: ${image}
video: ${video}
---
HERE
fi

vi "${file}"

if [ -n "${post}" ]
then
  if [ $(hostname) == 'devuan' ]
  then
    cd ~/fresh
    bundle exec jekyll build
    cp -R _site/* /var/www/html
  else
    scp -P 1122 "${file}" dominic@mail.lbs.ca:fresh/_posts/
    echo "You will need to run bundle and cp site on host"
  fi
fi

I just made some changes to capture posts made earlier properly.