A Jekyll plugin that enhances site.tags
and site.categories
to include documents from user-defined collections and easily
select documents based on a given tag or category.
Add jekyll-tagories
to your Gemfile
and then run bundle install
on your terminal. However, if your site doesn't have
a Gemfile, you may install it directly by running gem install jekyll-tagories
.
To enable this plugin, add it to your configuration file before building your site:
plugins:
- jekyll-tagories
Once enabled, {{ site.tags }}
and {{ site.categories }}
will include documents from your collections if they have been
tagged or categorized via their front matter.
Note: The support for categories are limited to just the document's front matter and will not consider a document's superdirectories as categories like your posts.
The plugin also exposes two Liquid filters to ease handling of the grouped pages and documents:
tagged
— retrieve documents that are tagged.data
attribute.{{ site.recipes | tagged }}
{{ site.recipes | tagged: 'cake' }}
categorized
— retrieve documents that are categorized.data
attribute.{{ site.recipes | categorized }}
{{ site.recipes | categorized: 'cakes' }}