diff --git a/create-blog-post.sh b/create-blog-post.sh new file mode 100755 index 00000000..627e4946 --- /dev/null +++ b/create-blog-post.sh @@ -0,0 +1,50 @@ +#!/bin/sh +BLOG_DIR="i2p2www/blog" + +if [ $# -lt 3 ] +then + echo "Usage: ./create-blog-post.sh name-in-url \"Title of blog post\" author [category]" + exit +fi + +name=$1 +title=$2 +author=$3 +category=$4 + +date=`TZ=UTC date +%Y-%m-%d` +datedir=`TZ=UTC date +%Y/%m/%d` +titleline=`printf '%*s' "$(expr length "$title")" | tr ' ' =` + +post="$BLOG_DIR/$datedir/$name.draft.rst" + +mkdir -p "$BLOG_DIR/$datedir" + +cat >"$post" <>"$post" <>"$post" <