Add a method that returns a given page name scoped to a directory.

This is to allow access to non unique pages.
This commit is contained in:
Odin Dutton and Sebastian Korfmann
2012-08-01 09:12:25 +10:00
committed by Odin Dutton
parent 8422b71204
commit be086d94b5
3 changed files with 30 additions and 2 deletions
+12
View File
@@ -199,6 +199,18 @@ module Gollum
@page_class.new(self).find(name, version)
end
# Public: Get the formatted page for a given page name scoped to a
# directory.
#
# name - The human or canonical String page name of the wiki page.
# dir - The directory String relative to the repo.
# version - The String version ID to find (default: @ref).
#
# Returns a Gollum::Page or nil if no matching page was found.
def scoped_page(name, dir, version = @ref)
@page_class.new(self).find(name, version || @ref, dir)
end
# Public: Get the static file for a given name.
#
# name - The full String pathname to the file.