posts: add link to reddit page, if it exists
[web.git] / personal / _plugins / categories.rb
index 69375dac3b699f1d73bfca2af598b155a33ee6a6..65776d72b067790e98677386f8df0f52c70ac1e9 100644 (file)
@@ -9,7 +9,7 @@ module Jekyll
 
       self.process(@name)
       self.read_yaml(File.join(base, '_layouts'), layout)
-      self.data['category'] = category
+      self.data['category'] = category # this tells the site template to add a link to the RSS feed
 
       category_title_prefix = site.config['blog']['category_title_prefix'] || 'Category: '
       self.data['title'] = "#{category_title_prefix}#{category.capitalize}"
@@ -20,6 +20,7 @@ module Jekyll
     safe true
 
     def generate(site)
+      return if site.config['blog'].nil?
       dir = site.config['blog']['category_dir'] || 'categories'
       if site.layouts.key? 'category_index'
         site.categories.each_key do |category|