Skip to content

Instantly share code, notes, and snippets.

@gerwitz
Created April 8, 2014 18:52

Revisions

  1. gerwitz created this gist Apr 8, 2014.
    12 changes: 12 additions & 0 deletions config.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # as if we could do this:
    # page "/tree", layout: "root"
    # page "/tree/*", layout: "trunk"
    # page "/tree/*/*", layout: "limb"

    page "/tree/*", layout: "limb"
    trunks = Dir.glob("./source/tree/*/index.md")
    trunks.each do |trunk_path|
    trunk = trunk_path.match(/.\/source\/tree\/([^\/]*)\/index\.md/).captures[0]
    page "/tree/#{top}/index.html", layout: "trunk"
    end
    page "/tree/index.html", layout: "root"