Skip to content

Instantly share code, notes, and snippets.

@robheittman
Created February 2, 2011 06:04
Show Gist options
  • Save robheittman/807312 to your computer and use it in GitHub Desktop.
Save robheittman/807312 to your computer and use it in GitHub Desktop.
def expand(parent)
parent.posts.each do |child|
link = "/collections#{@engine.getPathFor(child)}/rubyfragment.html"
$document.write <<-END
<div><a href='#{link}'>#{child['name']}<a></div>
#{child['description']}
<div style='padding-left: 20px'>
END
expand child
$document.write <<-END
</div>
END
end
end
<!-- the "src" attribute here must be site-absolute -->
<script type="server-parsed/ruby" src="/ruby/nav.rb"/>
require 'expand'
@engine = $GoGoEgo.getPlugin 'Posts'
expand @engine.current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment