lib/lookbook/entities/collections/page_collection.rb in lookbook-2.0.0 vs lib/lookbook/entities/collections/page_collection.rb in lookbook-2.0.1
- old
+ new
@@ -1,9 +1,11 @@
module Lookbook
class PageCollection < EntityCollection
include HierarchicalCollection
+ TREE_BUILDER = PageTreeBuilder
+
def load(page_paths, changes = nil)
file_paths = PageCollection.file_paths(page_paths)
reload_all(file_paths) # TODO: Fix incremental reloading
# changes.present? ? reload_changed(file_paths, changes) : reload_all(file_paths)
end
@@ -42,10 +44,10 @@
pages
end
def self.file_paths(directories)
directories.flat_map do |dir|
- PathUtils.normalize_paths(Dir["#{dir}/**/*.html.*", "#{dir}/**/*.md.*"].sort)
+ PathUtils.normalize_paths(Dir["#{dir}/**/*.html.*", "#{dir}/**/*.md.*", "#{dir}/**/*.md"].sort)
end
end
def self.entity(file_path)
File.basename(file_path).match?(%r{\[(.*?\w+)\]}) ? PageSectionEntity.new(file_path) : PageEntity.new(file_path)