bunteshaus.de/new.sh

18 lines
517 B
Bash
Raw Normal View History

2022-04-08 18:04:48 +02:00
#!/bin/bash
if [ ${#@} -eq 0 ]; then
echo "Titel des Artikels"
read -p ": " title
else
title="$@"
fi
date_long=$(date +%Y-%m-%dT%H:%M:%S:00+0200)
date=$(date +%Y-%m-%d)
title_=${title// /-}
mkdir -p "content/news/${date}-${title_}"
echo "---" > "content/news/${date}-${title_}/index.de.md"
echo "title: \"${title}\"" >> "content/news/${date}-${title_}/index.de.md"
echo "date: \"${date_long}\"" >> "content/news/${date}-${title_}/index.de.md"
echo "---" >> "content/news/${date}-${title_}/index.de.md"