Closed mohamnag closed 8 years ago
I could solve this problem by putting following code in a *.rb
file inside _plugin
directory:
module Jekyll
class Post
alias :populate_categories_org :populate_categories
def populate_categories
cats = Array(categories);
x = cats.index("_i18n")
cats.delete_at(x) unless x.nil?
x = cats.index(site.config['lang'])
cats.delete_at(x) unless x.nil?
self.categories = cats
populate_categories_org
end
end
end
I hope this would help fixing the problem on this plugin
thanks a lot. it resolves my problem as well. Hope they could integrate this fix.
@gitawego @mohamnag just create a PR and I will integrate it, thanks!
I would have loved to, but as I'm not a ruby developer I'm not sure how and where it should be put. I just started by reading some other plugins that I found with similar functionality and made this.
This is now integrated into 1.4.0. Thank you @mohamnag
not a deal! my pleasure.
I'm using the v1.2.9 of this plugin and I'm having troubles when using the ":categories" in my permalink setting inside
_config.yml
. The problem is that somehow thei18n
and the language name (likeen
) are added to the categories of all the multilingual posts insidei18n
directory.english is the default language of my website and I have the following directory structure:
which I wish to be structured as follows inside the output directory:
I have set the following setting in
_config.yml
file:however I get the following structure in output:
I'm not sure if this is the default functionality of the jekyll which adds the
i18n
anden
to the categories, but I expect this plugin to remove them from the categories of the post otherwise all permalinks who intend to use categories are useless.