A bunch of layout changes to support a new category and make everything work better.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user