Navigation Menu

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

Prevent capitalized taxonomy labels #1880

Closed
agoldst opened this issue Feb 18, 2016 · 8 comments
Closed

Prevent capitalized taxonomy labels #1880

agoldst opened this issue Feb 18, 2016 · 8 comments

Comments

@agoldst
Copy link

agoldst commented Feb 18, 2016

According to https://gohugo.io/taxonomies/usage/, Hugo "titleizes" taxonomy labels automatically. This is often not desirable if the taxonomy label is an acronym or a proper name. For example, suppose I tag some of my posts about making stylish webpages with the tag "CSS." Then, in the listing for all posts with that tag at /tags/css, the header will read "Css," which is not correct. There is no way to adjust this within the /layouts/taxonomy/tag.html template, because the .Title variable has already been title-cased. This happens even if the preserveTaxonomyNames option is true. An option to turn off this behavior and provide taxonomy terms as-is in the .Title variable in this case would be very helpful. I'm sorry I don't know go well enough to provide a PR.

I think this similar but not quite the same as the issues referenced in #1641 and #1407.

@agoldst
Copy link
Author

agoldst commented Feb 19, 2016

No, I put this wrong. I apologize. With preserveTaxonomyNames set to true, all-upper case terms are preserved. But all-lower-case terms are titlecased. This is still not ideal. Better to control this in the template, not enforce it in the data passed into templates.

@bep
Copy link
Member

bep commented Feb 19, 2016

But all-lower-case terms are titlecased.

That is not true. They are capitalized ("the one and only" becomes "The one and only" and not "The One And Only"), which is something different in my dictionary.

@bep
Copy link
Member

bep commented Feb 19, 2016

With that said, I'm going to close this issue as a duplicate. This will get solved once @spf13 get out of his think tank and we can make the taxonomies first-class citizens of Hugo.

@bep bep closed this as completed Feb 19, 2016
@agoldst
Copy link
Author

agoldst commented Feb 19, 2016

Thank you, and you're right that it's sentence-cased, not title-cased.
It's still making a decision for the user that the user might want to
make differently depending on how they use taxonomies. I'll keep an eye
out for that future update. AG

On Fri, Feb 19, 2016 at 12:33:29PM -0800, Bjørn Erik Pedersen wrote:

With that said, I'm going to close this issue as a duplicate. This will get solved once @spf13 get out of his think tank and we can make the taxonomies first-class citizens of Hugo.


Reply to this email directly or view it on GitHub:
#1880 (comment)

@bep
Copy link
Member

bep commented Feb 19, 2016

It's still making a decision for the user that the user might want to make differently depending on how they use taxonomies.

You are right. I thought about it when I introduced preserveTaxonomyNames. I may have done it wrong. Maybe I'll revert that.

@bep bep reopened this Feb 19, 2016
@mohae
Copy link
Contributor

mohae commented Feb 19, 2016

well, one option for the "Css" example is to use something like what golint does: a common initialisms lookup map so that CSS would be properly handled: https://github.com/golang/lint/blob/master/lint.go

I'm not suggesting that that map should be used as is. Also this would probably end up adding knobs.

@bep bep changed the title an option to prevent automatic title-casing of taxonomy labels at the head of taxonomy lists Prevent automatic capital-casing of taxonomy labels at the head of taxonomy lists Feb 19, 2016
@bep bep changed the title Prevent automatic capital-casing of taxonomy labels at the head of taxonomy lists Prevent automatic capitalized taxonomy labels Feb 19, 2016
@bep bep changed the title Prevent automatic capitalized taxonomy labels Prevent capitalized taxonomy labels Feb 19, 2016
@bep bep closed this as completed in ccd2f4c Mar 3, 2016
@ITSecMedia
Copy link
Contributor

Is there a new bug introduced in Version 0.19?

https://discuss.gohugo.io/t/hugo-0-19-preservetaxonomynames-true-false/5640/1

tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants