jessite/bin/newpost

24 lines
278 B
Bash
Executable file

#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/../"
if [ ! -e $1 ]; then
cat > "content/blog/$1.md" <<-EOF
+++
title = $1
draft = true
[taxonomies]
tags = []
+++
EOF
echo "Created ./content/blog/$1.md"
else
echo "ERROR: File already exists ./content/blog/$1.md"
fi