Skip to content

Instantly share code, notes, and snippets.

Last active June 9, 2020 07:27
What would you like to do?
Make Hugo New Post More Effective (OS X Only)
# ./hugox test-ok-dd title-of-post catalog
cd ~/repos/blog
path=`hugo new posts/$ | cut -f1 -d" "`
echo $path
sed -i '' "s|\".*\"|\"${zh}\"|" $path
sed -i '' '5i\
tags: [""]
' $path
sed -i '' "6i\\
categories: [\"$3\"]
" $path
open -a typora $path
# code $path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment