jekyll / jekyll-feed

:memo: A Jekyll plugin to generate an Atom (RSS-like) feed of your Jekyll posts
MIT License
847 stars 203 forks source link

Support filtering on any custom metadata #251

Closed reinboldg closed 5 years ago

reinboldg commented 5 years ago

Hi.

I had translate without any plugin my website in two languages : French and English. I just simply use a custom post metadata lang. It can be en, fr, or anything else. Also, I use a ref metadata to identify an unique post in languages.

Example:

A post in English

---
layout: post
lang: en
ref: compiling-monero-software-freebsd
title: "Compiling Monero software on FreeBSD"
permalink: /compiling-monero-software-freebsd/
categories: tech
---

The same post in French

---
layout: post
lang: fr
ref: compiling-monero-software-freebsd
title: "Compiler le logiciel Monero sur FreeBSD"
permalink: /compiler-monero-sur-freebsd/
categories: tech
---

As you seen, I write two files per post, one per language and then I filter like that:

<ul id="posts">
{% assign posts = site.posts | where: "lang", page.lang %}
{% for post in posts limit: site.post_limit %}
  <li>
    {{ post.date | date: "%d %b %Y" }}
    <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
  </li>
{% endfor %}
</ul>

It works perfectly, but I have only one feed generated by jekyll-feed which take all posts regardless of languages. So, I will generate two RSS feeds, one per language. To make it, it is possible to add a feature wish allow filtering a post metadata like lang with jekyll-feed? Something like the following in _config.yml:

plugins:
  - jekyll-feed
feed:
  filter:
    lang:
      en:
        path: /feed.xml
      fr:
        path: /flux.xml

Or have any other ideas to make it possible with jekyll-feed?

Best regards

reinboldg commented 5 years ago

I also tried to use category and collections but nothing work. I see only one feed.xml to my build directory.

jekyllbot commented 5 years ago

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.