jekyll-feed
jekyll-feed copied to clipboard
doesn't handle tags with spaces or hyphens
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?
Have you tried using the front matter key named as tags instead of the singular?
(I'm just checking to see if that works..)
Have you tried using the front matter key named as
tagsinstead 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.
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:
- It is probably unnecessary to be so strict. Slashes need to be prohibited, but most other things should be ok.
- In any case, the examples in the README.md use hyphens, so they are just plain wrong.
- It might at least be nice to write out a message when a tag gets omitted due to this.
@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.
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.
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.
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.
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.
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.
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.
My above post is still valid. GitHub Pages plugin is still at 0.15.1.
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.
My above post is still valid. GitHub Pages plugin is still at 0.15.1.