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
Fix case-sensitive categories will override each other. #1412
base: master
Are you sure you want to change the base?
Conversation
Looks like old, non-downcase categories will be saved in the new |
Which lines are you referring to? Basically this changes did two things:
|
@@ -127,6 +127,26 @@ def write_category_indexes | |||
end | |||
end | |||
|
|||
# Convert categories into downcase keys to solve issue that 'Git' and 'git' will override each other | |||
alias orig_site_payload site_payload | |||
def site_payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems rather verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you suggesting removing the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I was refering to the code below, sorry -- It just seems like a lot of intermediate assignments. The comment above is actually great as it gives the reason for this being there.
I've had people complain to me about downcasing of categories. For example, I really want the category |
@parkr I agree with your point of view, but the problem here is that, there are 2 parts of this thing: links and folders. This plugin downcase links but not the folders. What I am trying to do here is make this consistent - either downcase all of them or just leave them alone. |
@hSATAC That makes sense. Won't it break links on current sites? |
AFAIK it won't. The links was generate by |
Let's say I have 2 categories
Git
andgit
.For category links, they were generated by
category.to_url
so they will link to the same urlcategories/git
But in
plugins/category_generator.rb
, they were treated like different categories, so one of them will be overridden by the other. I think we should treat these as the same category. After all, they're generated to the same folder, and linked to the same url.