middleman / middleman-blog

Blog Engine Extension for Middleman
https://middlemanapp.com
MIT License
326 stars 179 forks source link

Tag pages miss articles due to case-sensitiveness #313

Closed matiasgarciaisaia closed 9 months ago

matiasgarciaisaia commented 8 years ago

middleman-blog's BlogData is grouping articles for each tag in a case-sensitive way - ie, foo and Foo are two different tags.

But the destination path of the page is case-insensitive - ie, both foo and Foo go to /blog/with-tag/foo.html.

The result is that you get only one page for those tags (say, just foo), but missing the other tag's articles (ie, you don't get the Foo articles shown).

I'd expect tags to be case-insensitive - so I'd add .downcase in both related snippets. You get a single foo tag (that could be shown as Foo or not), that shows both foo and Foo articles. About wether to show foo or Foo as the tag name, we can use the first/last tag's format - I don't care. If the casing shown isn't the one the user wants, they can always re-tag the articles so it matches.

iwarner commented 7 years ago

Hiya @matiasgarciaisaia

I see what you mean I have replicated this, and I think it makes sense in terms of what you are saying - the other option is to create Tag files that are not case sensitive, but thats a poor option for URL continuity.

Could you please remove the PRs you have done and resubmit a new PR along with a Feature test for this submission.

matiasgarciaisaia commented 7 years ago

Ian, I'm actually not keen at all doing feature tests.

I can totally rework the PR, but I'd need your assistance to create the feature tests. Do you have any test that's too similar to the ones I should create? Or would it be OK if I give collaborators access to edit my PR so you can do the tests for me?

Thank you very much

iwarner commented 7 years ago

I don't think there are any Fixtures for this - but basically we want to test that Posts tagged with essentially the same word 'Foo' | "foo" bring up the same list of posts on the Tag template. And that these Tags link to the correct template.

Probably add to this set of tests https://github.com/middleman/middleman-blog/blob/master/features/tags.feature

Whats the link to your Blog / Repo please?