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:
committed by
Odin Dutton
parent
8422b71204
commit
be086d94b5
+2
-2
@@ -364,9 +364,9 @@ module Gollum
|
||||
# version - The String version ID to find.
|
||||
#
|
||||
# Returns a Gollum::Page or nil if the page could not be found.
|
||||
def find(name, version)
|
||||
def find(name, version, dir = nil)
|
||||
map = @wiki.tree_map_for(version.to_s)
|
||||
if page = find_page_in_tree(map, name)
|
||||
if page = find_page_in_tree(map, name, dir)
|
||||
page.version = version.is_a?(Grit::Commit) ?
|
||||
version : @wiki.commit_for(version)
|
||||
page.historical = page.version.to_s == version.to_s
|
||||
|
||||
Reference in New Issue
Block a user