Skip to content

Instantly share code, notes, and snippets.

@robheittman
Created February 1, 2011 22:38
Show Gist options
  • Save robheittman/806874 to your computer and use it in GitHub Desktop.
Save robheittman/806874 to your computer and use it in GitHub Desktop.
Some navigation using the Posts API
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
@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