For a few reasons I can’t put the Push Code site on github. However, I do want to do something like this, probably also with a “Deploy to Heroku” button so people can get a app running and browse the code at the same time.
Re you question about navigation, it sounds like you’ve got a root level Homepage node and everything a descendant of that. I usually prefer a slightly flatter structure, something like:
The point is there’s no right or wrong way of doing this, so there’s going to be different techniques needed if you want a automatic navigation.
One thing you can do is build the navigation in a before filter, eg:
# before_action_node is a class method available to ApplicationController
# You can pass options to it. Eg:
# before_node_action(only: [:page, :article], &block)
# In this case we don't need to pass any options - it will be triggered on every node.
# Assuming your home page node is a HomePage class
# this example defines a @navigation instance variable
# an array of all the homepage's children, available in all your views
@navigation = HomePage.first.children.published.all
# Alternatively you could try a different technique
# this example @navigation is a hash tree containing the entire site
# only recommended if your site is relatively small
# and you'd need a helper method to iterate through the hash and render the nav
@navigation = PushType::Node.hash_tree
Hope this helps point you in the right direction