now per category feeds are optional (default to off) this should improve speed for the many people who don't use this feature

This commit is contained in:
Brandon Mathis 2012-02-19 16:27:45 -06:00
parent a814ca76ea
commit c26aa7e9a0
2 changed files with 10 additions and 7 deletions

View File

@ -18,6 +18,7 @@ date_format: "ordinal"
# RSS / Email (optional) subscription links (change if using something like Feedburner)
subscribe_rss: /atom.xml
subscribe_email:
category_feeds: false
# RSS feeds can list your email address if you like
email:

View File

@ -36,7 +36,7 @@ module Jekyll
@name = 'index.html'
self.process(@name)
# Read the YAML data from the layout page.
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
self.read_yaml(File.join(base, '_layouts'), 'category_feed.xml')
self.data['category'] = category
# Set the title for this page.
title_prefix = site.config['category_title_prefix'] || 'Category: '
@ -63,7 +63,7 @@ module Jekyll
@name = 'atom.xml'
self.process(@name)
# Read the YAML data from the layout page.
self.read_yaml(File.join(base, '_layouts'), 'category_feed.xml')
self.read_yaml(File.join(base, '_includes/custom'), 'category_feed.xml')
self.data['category'] = category
# Set the title for this page.
title_prefix = site.config['category_title_prefix'] || 'Category: '
@ -94,11 +94,13 @@ module Jekyll
self.pages << index
# Create an Atom-feed for each index.
feed = CategoryFeed.new(self, self.source, category_dir, category)
feed.render(self.layouts, site_payload)
feed.write(self.dest)
# Record the fact that this page has been added, otherwise Site::cleanup will remove it.
self.pages << feed
if self.config['category_feeds']
feed = CategoryFeed.new(self, self.source, category_dir, category)
feed.render(self.layouts, site_payload)
feed.write(self.dest)
# Record the fact that this page has been added, otherwise Site::cleanup will remove it.
self.pages << feed
end
end
# Loops through the list of category pages and processes each one.