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

There is an issue with tags with incorrect casing #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hazzik
Copy link
Contributor

@hazzik hazzik commented Oct 1, 2014

If we have some posts with the same tag, but written with different cases then some posts are missing in archives

@hazzik
Copy link
Contributor Author

hazzik commented Oct 1, 2014

Also, if for some reasons two tags have the same slug, then posts are missing too...

@alfredxing
Copy link
Member

I'm wondering if this issue is with Archives or with Jekyll (since the Archives code simply iterates over the tags and gets the posts for each). Can you check the size/contents of site.tags["test-tag"]?

@hazzik
Copy link
Contributor Author

hazzik commented Oct 1, 2014

Can you check the size/contents of site.tags["test-tag"]?

It would be 1, of-cource. I think the issue is particularly with Archives, as it uses a slugged file name to generate an archive.

But, probably it needs to be fixed in jekyll itself.

@hazzik
Copy link
Contributor Author

hazzik commented Oct 6, 2014

As intermediate solution I'd propose to add a number suffix to the slug so the archives would not be missed. This would also address jekyll/jekyll#2965

@alfredxing
Copy link
Member

I think most of the issues causing this originate from Jekyll itself; it would probably better to move this conversation to the main repo (it would get some more exposure as well), but I'll keep this issue open until the problem's resolved.

I don't like the idea of adding a number suffix, since that complicates the slug readability in the end. It is a solution, though, so we can discuss it further.

@hazzik
Copy link
Contributor Author

hazzik commented Oct 7, 2014

So, infact we have 2 problems here which lead to the loss of entires on archive page:

  1. Tags/Categories with different cases
  2. Tags/Categories with the same slug

@alfredxing
Copy link
Member

I'll investigate further into the first problem (it should be a problem with Jekyll though). Can you give an example of the second problem?

@hazzik
Copy link
Contributor Author

hazzik commented Oct 7, 2014

it should be a problem with Jekyll though

They put 3.0 milestone on it.

Can you give an example of the second problem?

Basically it is the problem with non-latin alphabets (can I call them alphabets?) where all non-latin letters are stripped from the slug. So for different words it will generate the same slug (empty almost every time).

@alfredxing
Copy link
Member

So in that case issue 2 would be jekyll/jekyll#2965, no? I'm just trying to check if there's anything specific to Archives that is causing these issues.

@hazzik
Copy link
Contributor Author

hazzik commented Oct 8, 2014

Yes, these are jekyll/jekyll#2965 and jekyll/jekyll#2977

@ghost
Copy link

ghost commented May 12, 2016

I actually think it's a problem with how the tag and cat hashes are accessed, see my comment here: #43 (comment)

@alfredxing
Copy link
Member

Hmm, my position on this is still: are tags supposed to be insensitive or not? If they are case-insensitive, we shouldn't be merging them; if they are case-sensitive, something should be done with Utils.slugify in the main repo.

@ghost
Copy link

ghost commented Jan 25, 2017

The current method of generating tags creates merge conflicts in tag hashes. Post arrays are over-written and dropped as a result of the merge conflicts, and this causes the missing pages in the post archives. I give an explanation in #43 (comment). This problem is not limited to casing only, it also occurs when tags have dashes, as demonstrated by 18F/18f.gsa.gov#1947 and #82.

So regardless of tag casing, the merge-conflict problem needs to be fixed so that arrays are not dropped and tag archives are generated properly.

My opinion is that tags should default to insensitive, while supporting a way for blog author to set custom casing for specific tag archive pages. I demonstrate my approach in #43 (comment) however there is probably a better way to handle this.

@alfredxing
Copy link
Member

I just realized that a part of my previous comment didn't make any sense. 😛
I meant to say, if tags are case insensitive, we do need to merge them, as you suggested.

In #82, I suggested as the case-insensitive solution, to slug the tags and merge them that way; this would fix both this issue (it would convert all tags to lowercase), and the dashes one. It would also guarantee there would no longer be any URL conflicts (since we use the same slugify to generate the URL).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants