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
function sitegen | |
cd /home/public | |
rm *.html | |
cd /home/public/posts | |
set posts (ls) | |
ser webdir /home/public | |
set header $webdir/conf/header.html | |
set footer $webdir/conf/footer.html | |
for post in $posts | |
if test (echo $post | sed "s/.*\.//") = md | |
set html (echo $post | sed "s/\.md\$/\.html/") | |
touch $webdir/$html | |
cat $header | sed (echo s/PAGENAME/$html/) > $webdir/$html | |
markdown $post >> $webdir/$html | |
cat $footer >> /home/public/$html | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment