-
-
Save trauber/985694 to your computer and use it in GitHub Desktop.
Create static html with mustache and favorite markup
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
#! /bin/bash | |
# Use mustache and your favorite markup to create static html. | |
# Use a markup that does standard read/write or change script. | |
FILE=$1 | |
MARKUP=/usr/local/bin/markdown | |
echo "{{content}}" > mustache.tmp | |
mustache $FILE mustache.tmp | $MARKUP > content.tmp | |
sed -n '1,/^content: *|/ p' $FILE > yml.tmp | |
cat content.tmp | awk '{ print " " $0 }' >> yml.tmp | |
echo "---" >> yml.tmp | |
mustache yml.tmp template.mustache | |
rm *.tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment