A bunch of layout changes to support a new category and make everything work better.

This commit is contained in:
2016-05-22 21:49:37 -04:00
parent a053ac1be7
commit f5320c3717
8 changed files with 51 additions and 20 deletions

View File

@ -9,8 +9,15 @@ class CategoryPage < Jekyll::Page
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
self.data['category'] = category
category_title = site.config["category_titles"][category] || category.capitalize
self.data['title'] = "#{category_title}"
config = site.config['category_metadata'][category]
if config.nil?
self.data['title'] = category.capitalize
self.data['description'] = ''
else
self.data['title'] = config['title']
self.data['description'] = config['description']
end
end
end
@ -22,7 +29,7 @@ class CategoryPageGenerator < Jekyll::Generator
return
end
site.categories.each_key do |category|
site.config['category_metadata'].each_key do |category|
site.pages << CategoryPage.new(site, site.source, category)
end
end