Skip to content
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

Custom feed for categories doesn't work if it contains åäö #356

Closed
Hund opened this issue Dec 17, 2021 · 9 comments · Fixed by #357
Closed

Custom feed for categories doesn't work if it contains åäö #356

Hund opened this issue Dec 17, 2021 · 9 comments · Fixed by #357

Comments

@Hund
Copy link

Hund commented Dec 17, 2021

I just tried adding custom feeds for a few catergories to one of my websites. One of this categories is "Träffar" (Meetups).

It does generate a feed, but it doesn't contain any posts.

I'm running Jekyll 4.2.1 with jekyll-feed 0.15.1.

@ashmaroli
Copy link
Member

Hi,
Could you provide the exact config settings and steps to help me try reproducing this with a bare-bones site?

@Hund
Copy link
Author

Hund commented Dec 17, 2021

Sure! The relevant part of my config:

feed:
  categories:
    - Träffar

The category is named "Träffar". The feed url is:

http://localhost:4000/feed/Tr%C3%A4ffar.xml

Or:

http://localhost:4000/feed/Träffar.xml

I'm honestly not sure. It's shown as "Träffar" in the adressbar, but when I copy the url it turns into "Tr%C3%A4ffar".

The feed looks like this for me:

<feed xmlns="http://www.w3.org/2005/Atom">
<generator uri="https://jekyllrb.com/" version="4.2.1">Jekyll</generator>
<link href="http://localhost:4000/feed/Tr%C3%A4ffar.xml" rel="self" type="application/atom+xml"/>
<link href="http://localhost:4000/" rel="alternate" type="text/html"/>
<updated>2021-12-17T17:44:45+01:00</updated>
<id>http://localhost:4000/feed/Tr%C3%A4ffar.xml</id>
<title type="html">Linuxkompis | Träffar</title>
<subtitle>En vänlig Linux-gemenskap för alla!</subtitle>
</feed>

@ashmaroli
Copy link
Member

Okay. I was able to reproduce this.
The reason behind this is that the feed template doesn't take categories into consideration:

{% assign posts = posts | where: "category", page.category %}

The fix is very simple:

- {% assign posts = posts | where: "category", page.category %}
+ {% assign posts = posts | where: "categories", page.category %}

@Hund Are you willing to submit a pull request to patch this..?

@ashmaroli ashmaroli added the bug label Dec 18, 2021
@Hund
Copy link
Author

Hund commented Dec 18, 2021

Okay. I was able to reproduce this. The reason behind this is that the feed template doesn't take categories into consideration:

{% assign posts = posts | where: "category", page.category %}

The fix is very simple:

- {% assign posts = posts | where: "category", page.category %}
+ {% assign posts = posts | where: "categories", page.category %}

@Hund Are you willing to submit a pull request to patch this..?

Great!

Me? Where? And what exactly should I do?

@ashmaroli
Copy link
Member

Me? Where? And what exactly should I do?

Sorry. I didn't mean to get you tensed / confused..
My bad.

I'll do the needful myself. Thanks for reporting.

@Hund
Copy link
Author

Hund commented Dec 18, 2021

Me? Where? And what exactly should I do?

Sorry. I didn't mean to get you tensed / confused.. My bad.

I'll do the needful myself. Thanks for reporting.

Thank you! I appreciate it. :)

@Hund
Copy link
Author

Hund commented Dec 19, 2021

I'm not sure why, but my extra feeds doesn't update anymore. If I add any posts, they don't show up in the extra feed like they should.

@parkr
Copy link
Member

parkr commented Dec 19, 2021

Do you have a link to your site's source, or do you have a sample where you can reproduce the effect? This change doesn't seem like it would affect whether new posts would be added.

@Hund
Copy link
Author

Hund commented Dec 20, 2021

Do you have a link to your site's source, or do you have a sample where you can reproduce the effect? This change doesn't seem like it would affect whether new posts would be added.

The issue is probably me. Feel free to have a look at it. :)

Linuxkompis_.zip

@jekyll jekyll locked and limited conversation to collaborators Dec 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants