jekyll / jekyll-feed

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

doesn't handle tags with spaces or hyphens #377

Open petere opened 2 years ago

petere commented 2 years ago

I create a new Jekyll site:

jekyll new test

Edit the _config.yml to include:

feed:
  tags: true

Edit the example post _posts/2022-09-02-welcome-to-jekyll.markdown to include the line:

tag: foo_bar

Then build:

bundle exec jekyll build

I see

...
Jekyll Feed: Generating feed for posts
Jekyll Feed: Generating feed for posts tagged foo_bar

Ok great.

Now instead do

tag: foo-bar

or

tag: foo bar

and no feed is created for the tag (and no message is printed).

I see that the jekyll-feed documentation itself uses examples of tags with hyphens. Also, the Jekyll documentation goes out of its way to explain how to handle tags with spaces in them. So I think both of these ought to be supported. But jekyll-feed apparently silently drops them. What's going on?

ashmaroli commented 2 years ago

Have you tried using the front matter key named as tags instead of the singular? (I'm just checking to see if that works..)

petere commented 2 years ago

Have you tried using the front matter key named as tags instead of the singular?

That doesn't make a difference.

I can see that Jekyll proper parses the tags correctly in any case, because the produced top-level feed.xml contains things like

<category term="jekyll" /><category term="update" /><category term="foo-bar" />

So the tags are recognized, and at least parts of jekyll-feed can see them, just the per-tag feeds somehow disappear in some cases.

petere commented 2 years ago

Oh, I found this in the code:

https://github.com/jekyll/jekyll-feed/blob/21a7fc9ef03ac954be4d64c8ea34918ee76e58f4/lib/jekyll-feed/generator.rb#L92-L94

I would say:

ashmaroli commented 2 years ago

@petere Thanks for digging into the source code. I agree with you that the code directly contradicts the example in the README. You're welcome to submit a pull request to patch the source code if you're interested.

Now that I see it, I am not liking the regex filter without it being mentioned in the README. In other words, if Jekyll Core thinks, foo-bar is a tag, this plugin should just proceed to generate the feed for that tag instead of extra filtering.

jekyllbot commented 2 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/main 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.

parkr commented 1 year ago

Adding a space to the regexp in the code you found and adding a test to ensure the spaces work fine would fix this issue.

CookiePLMonster commented 1 year ago

Adding a space to the regexp in the code you found and adding a test to ensure the spaces work fine would fix this issue.

Not exactly an option when you are deploying to GitHub Pages, however.

jekyllbot commented 1 year 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/main 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.

CookiePLMonster commented 1 year ago

Still an issue at least when using a GitHub Pages gem - it might be a good idea to politely remind GitHub to update jekyll-feed to the newest version, but according to changelogs no changes related to this bug should be expected.

jekyllbot commented 1 year 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/main 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.

CookiePLMonster commented 1 year ago

My above post is still valid. GitHub Pages plugin is still at 0.15.1.

jekyllbot commented 1 year 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/main 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.

CookiePLMonster commented 1 year ago

My above post is still valid. GitHub Pages plugin is still at 0.15.1.