A jekyll plugin to generate category pages using your own template.
Add jekyll-categorizer
to your site's Gemfile under the
jekyll_plugins
group:
group "jekyll_plugins" do
gem "jekyll-categorizer"
end
And then execute:
$ bundle install
Configure in _config.yml
the following settings:
jekyll_categorizer:
namespace: categories # this will be used for URL namespacing (E.g. /categories/foo)
layout: category # this should be your own layout
and lastly, in your specified layout, make use of the following snippet:
# ...
{% for post in site.categories[page.category] %}
# ...
{% endfor %}
# ...
To iterate over every category post. This should build a category page for every category found in your
articles under _posts
.
E.g. If you have a category foo
then you'd be able to see every post
for that category under /categories/foo.html
(using categories
namespace)
The MIT License.
Check Code of Coduct.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request