Skip to content

Instantly share code, notes, and snippets.

@Qooh0 Qooh0/create_post.sh
Created Jan 26, 2020

Embed
What would you like to do?
Create blog post template for Gatsby.js
#!/usr/bin/env sh
set -eu
## How to use
# ./create_post.sh *title*
## Output
# content/posts/2020-01-26--*title*/
# ./index.md
DATETIME=`date +%Y-%m-%d--`
TARGET_DIR=content/posts/$DATETIME$1
mkdir $TARGET_DIR
cat <<EOF > $TARGET_DIR/index.md
---
title: $1
category: "announcement"
cover: //*TODO*
author: *me*
---
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.