-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About tags #8
Comments
Is it possible to add support for filtering posts using tags? |
If you want to paginate your posts by tags, you could check Jekyll plugin paginate v2. You should be able to easily filter posts with it. If not, you can always use liquid like this: {% for post in site.posts %}
{% if post.tags contains "yourfilter" %}
Your post
{% endif %}
{% endfor %} |
I'm using this theme as well, and ended up creating my own minimal way to do tags. I looked at several themes and plugins for Jekyll, but most do this client-side which I think delivers an unacceptable user-experience, often without a permalink to "posts with tag X" as it relied on clicking buttons. The way I do it is to create an empty placeholder page for each of the tags I want to use, which then gets generated by Jekyll into the list of posts. For most themes, this tag page layout would be similar to your home page, except iterating Source code: github.com/Krinkle/timotijhof.net - _posts/
- 2020-04-04-example.md
- …
- _layouts/
- tag.html
- tags/
- some.md
- tags.md
- here.md posts/2020-04-04-example.md: ---
layout: post
title: "Example"
tags: some here
---
Content here. … tags/some.md: ---
layout: tag
title: Something
tag: some
--- Example: https://timotijhof.net/tags/wikipedia/. |
@Krinkle - thanks for sharing your work, I will use your version, I really like your improvements. |
There are tags? And they will work (i.e. click to select articles according to labels)?
The text was updated successfully, but these errors were encountered: