-
Notifications
You must be signed in to change notification settings - Fork 101
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
Remove dashes from archive tags #82
base: master
Are you sure you want to change the base?
Conversation
Remove sqeeze
Add tests that check for tagless dashes
/cc @jekyll/archives |
I'll have time to review and address the build failures next week. |
This is an interesting one! 😜 If we want to merge tags (i.e. have If we don't want to merge tags, I'm not sure if all-out removing dashes is the way to go... I can imagine cases where the dash would make a difference in terms of meaning (also, removing the dash in this way would change how it's displayed via Thoughts, comments, discussion appreciated! |
@alfredxing, I don't think I did a great job explaining the issue that we were having, so let me clarify. Certain tags that differed only by if/when they were dash delimited, Instances where they were merged:
Instances where they were made distinct:
Dash delimiting all the tags isn't an ideal reasons you stated above:
But, this seemed to be the only way I could quickly ensure that the tags weren't inconsistently merged. I'm guessing a better approach would be to make sure that any dash delimited tag is a distinct tag in FWIW we have since avoided this entirely simply by making sure that our tags don't overlap. If fixing this bug is a major hassle, maybe we could add documentation encouraging people to be stricter with their configuration. We are using a gem to manage Jekyll front matter that has helped a lot with this. |
This PR fixes a problem that was causing some tag archives to be non-existent.
What this fixes
Basically, it creates a custom
post_attr_hash
method that removes dashes from a tag before assigning its value to the hash thatsite.tags
returns. This way there is only one reference that is a valid url when it has dashes and there is no tag conflict.This is related to #24
Why?
On our site, some dash-delimited tag archives were were inaccessible because they closely resembled tags without dashes in them. For instance, the
user-centered design
tag was being confused with theuser centered design
tag. If there was one post with each of the above tags, visiting/tags/user-centered-design/
would bring up the post that was first in the list ofsite.posts
instead of posts associated with both tags.