module Roda::RodaPlugins::HashBranchViewSubdir

The hash_branch_view_subdir plugin builds on the hash_branches and view_options plugins, automatically appending a view subdirectory for any matching hash branch taken. In cases where you are using a separate view subdirectory per hash branch, this can result in DRYer code. Example:

plugin :hash_branch_view_subdir

route do |r|
  r.hash_branches
end

hash_branch 'foo' do |r|
  # view subdirectory here is 'foo'
  r.hash_branches('foo')
end

hash_branch 'foo', 'bar' do |r|
  # view subdirectory here is 'foo/bar'
end