diff options
Diffstat (limited to 'lib/page_index.rb')
-rw-r--r-- | lib/page_index.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/page_index.rb b/lib/page_index.rb index 585fd57..31d4682 100644 --- a/lib/page_index.rb +++ b/lib/page_index.rb @@ -28,13 +28,15 @@ class IndexPage < LocalPage @ls ||= Dir::entries(local_infile) .select{|fname|not fname.start_with?(".")} .map{|fname|"#{local_infile}/#{fname}"} - .select{|path|Dir::exist?(path) or Config::get.html_suffixes.include?(File::extname(path).gsub(/^[.]/, ''))} end def index_pages if @pages.nil? @pages = Set[] for path in _ls - @pages.add( Dir::exist?(path) ? IndexPage::new(path) : LocalPage::new(path) ) + page = LocalPage::load(path) + unless page.nil? + @pages.add(page) + end end for data in (_metadata['external'] || []) @pages.add(RemotePage::new(data)) @@ -59,7 +61,7 @@ class IndexPage < LocalPage unless depth <= 1 ret += "<section><h#{depth}>[#{atom_title}](#{cururl.route_to(url)})</h#{depth}>\n\n" end - for page in index_pages.select{|page|not page.is_a?(IndexPage)}.sort_by{|page|page.atom_published} + for page in index_pages.select{|page|not page.is_a?(IndexPage)}.sort_by{|page|page.atom_updated}.reverse ret += page.index_link(cururl, depth+1) end ret += "\n" |