lib/nanoc/data_sources/filesystem.rb in nanoc-2.0.2 vs lib/nanoc/data_sources/filesystem.rb in nanoc-2.0.3
- old
+ new
@@ -150,13 +150,14 @@
# a basename (the part before the extension) and an extension. Unlike page
# content files, the extension _is_ used for determining the layout
# processor; which extension maps to which layout processor is defined in
# the layout processors.
def layouts
- Dir["layouts/*"].reject { |f| f =~ /~$/ }.map do |filename|
+ Dir["layouts/**/*"].reject { |f| f =~ /~$/ }.map do |filename|
# Get layout details
extension = File.extname(filename)
- name = File.basename(filename, extension)
+ #name = File.basename(filename, extension)
+ name = filename.gsub(/layouts\//,"").gsub(extension,"")
content = File.read(filename)
# Build hash for layout
{ :name => name, :content => content, :extension => extension }
end