blog/scripts/new-post.sh

17 lines
248 B
Bash
Raw Normal View History

2021-12-31 07:37:45 +00:00
#!/bin/bash
[[ "$1" = "" ]] && echo No filename given for new post\! && exit 1
file="$1"
2022-08-08 19:00:04 +00:00
cat << EOF | tee content/posts/"$file"
2021-12-31 07:37:45 +00:00
---
2022-08-08 19:00:04 +00:00
title: $(basename -s .md "$file")
2021-12-31 07:37:45 +00:00
date: $(date '+%F')
draft: false
description:
category: article
image:
---
EOF