Merge branch 'enh_pages_in_payload'

This commit is contained in:
Kris Brown 2010-02-27 14:11:28 +00:00
commit ad4a80a653
3 changed files with 17 additions and 9 deletions

View File

@ -119,15 +119,13 @@ module Jekyll
"#<Jekyll:Page @name=#{self.name.inspect}>"
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

View File

@ -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

View File

@ -14,10 +14,19 @@ layout: nil
{% for post in site.posts %}
<url>
<loc>http://example.com/{{ post.url }}/</loc>
<loc>http://example.com{{ post.url }}/</loc>
<lastmod>{{ post.date | date: "%Y-%m-%d" }}</lastmod>
<changefreq>monthly</changefreq>
<priority>0.2</priority>
</url>
{% endfor %}
{% for page in site.html_pages %}
<url>
<loc>http://example.com{{ page.url }}</loc>
<lastmod>{{ site.time | date: "%Y-%m-%d" }}</lastmod>
{% if page.changefreq %}<changefreq>{{ page.changefreq }}</changefreq>{% endif %}
{% if page.priority %}<priority>{{ page.priority }}</priority>{% endif %}
</url>
{% endfor %}
</urlset>