diff options
Diffstat (limited to 'lib/static_page.rb')
-rw-r--r-- | lib/static_page.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/static_page.rb b/lib/static_page.rb index 7ef529b..d7d6529 100644 --- a/lib/static_page.rb +++ b/lib/static_page.rb @@ -194,6 +194,13 @@ class StaticPage self.name end + # + # returns a child matching +name+, if any. + # + def child(name) + children.detect {|child| child.name == name} + end + protected def child_tree @@ -279,7 +286,7 @@ class StaticPage # def content_files if @simple_page - [[@file_path + @suffix,nil]] + [[[@file_path, @suffix].join,nil]] elsif File.directory?(@file_path) Dir.foreach(@file_path).collect { |file| if file && file =~ LOCALE_FILE_MATCH |