Class: Jekyll::Document
- Inherits:
-
Object
- Object
- Jekyll::Document
- Defined in:
- lib/jekyll-multiple-languages-plugin.rb
Overview
class Document
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.
304 305 306 307 308 309 310 311 312 313 |
# File 'lib/jekyll-multiple-languages-plugin.rb', line 304 def populate_categories data['categories'].delete("_i18n") data['categories'].delete(site.config['lang']) merge_data!({ 'categories' => ( Array(data['categories']) + Utils.pluralized_array_from_hash(data, 'category', 'categories') ).map(&:to_s).flatten.uniq }) end |
#populate_categories_org ⇒ Object
295 |
# File 'lib/jekyll-multiple-languages-plugin.rb', line 295 alias :populate_categories_org :populate_categories |