Last active
June 2, 2018 16:47
-
-
Save zachwhalen/20e6e0ba7eb88fa66f8e16e2077ae168 to your computer and use it in GitHub Desktop.
A bash script to create and open a new text file with the appropriate header for a blog post in a Pico site.
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
nn() { | |
# the header template | |
ft="--- | |
Title: Untitled Note | |
Template: blog-post | |
Description: New Note | |
Date: $(date) | |
Tags: | |
---"; | |
# save the date in seconds so it can be used twice | |
dn=$(date +%s); | |
# make the file | |
echo "$ft" > ~/pg/notes/note-$dn.md; | |
# open the file in Sublime | |
subl ~/pg/notes/note-$dn.md; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment