You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
344 B

#!/bin/sh
# This script generates a new blog post.
# Example usage:
# ./contrib/gen-post.sh My first post
DATE=$(date +"%Y-%m-%d")
TITLE="$@"
FILE_TITLE=$(printf "$TITLE" | tr " " "-" | tr "[A-Z]" "[a-z]")
FILE_NAME="$DATE-$FILE_TITLE.md"
FULL_PATH="content/posts/$FILE_NAME"
cat > $FULL_PATH <<EOF
---
title: $TITLE
date: "$DATE"
---
EOF