blog/scripts/new-post.sh
2022-08-08 12:00:04 -07:00

17 lines
248 B
Bash

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