Skip to content

Instantly share code, notes, and snippets.

@wdkrnls
Created December 22, 2010 13:59
Show Gist options
  • Save wdkrnls/751536 to your computer and use it in GitHub Desktop.
Save wdkrnls/751536 to your computer and use it in GitHub Desktop.
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