From ef2fabb189c63fa2cdca65e52c4664a43bc468f7 Mon Sep 17 00:00:00 2001 From: Kris Brown Date: Sat, 27 Feb 2010 14:09:07 +0000 Subject: [PATCH] also provide html_pages. this is better for sitemaps should you wish to auto-populate page entries --- lib/jekyll/page.rb | 14 ++++++-------- lib/jekyll/site.rb | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index c7101179..12544e7d 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -119,15 +119,13 @@ module Jekyll "#" end - private + def html? + output_ext == '.html' + end - def html? - output_ext == '.html' - end - - def index? - basename == 'index' - end + def index? + basename == 'index' + end end diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index 2e3d9c98..e43d0b89 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -237,6 +237,7 @@ module Jekyll "time" => self.time, "posts" => self.posts.sort { |a,b| b <=> a }, "pages" => self.pages, + "html_pages" => self.pages.reject { |page| !page.html? }, "categories" => post_attr_hash('categories'), "tags" => post_attr_hash('tags')})} end