Class: Jekyll::Post
- Inherits:
-
Object
- Object
- Jekyll::Post
- Defined in:
- lib/jekyll-multiple-languages-plugin.rb
Overview
class Post
Instance Method Summary collapse
-
#populate_categories ⇒ Object
populate_categories.
- #populate_categories_org ⇒ Object
Instance Method Details
#populate_categories ⇒ Object
populate_categories
Monkey patched this method to remove unwanted strings (“_i18n” and language code) that are prepended to posts categories because of how the multilingual posts are arranged in subfolders.
221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/jekyll-multiple-languages-plugin.rb', line 221 def populate_categories categories_from_data = Utils.pluralized_array_from_hash(data, 'category', 'categories') self.categories = ( Array(categories) + categories_from_data ).map {|c| c.to_s.downcase}.flatten.uniq self.categories.delete("_i18n") self.categories.delete(site.config['lang']) return self.categories end |
#populate_categories_org ⇒ Object
212 |
# File 'lib/jekyll-multiple-languages-plugin.rb', line 212 alias :populate_categories_org :populate_categories |