Created
January 26, 2020 06:08
-
-
Save Qooh0/4106bf4205b0a5cdc27643bc07c8dc44 to your computer and use it in GitHub Desktop.
Create blog post template for Gatsby.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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