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

Taxonomies Overriding Default Casing #1026

Open
tommertron opened this issue Feb 24, 2025 · 6 comments
Open

Taxonomies Overriding Default Casing #1026

tommertron opened this issue Feb 24, 2025 · 6 comments

Comments

@tommertron
Copy link
Contributor

Hey! So I'm tying to get my tags to show up exactly how I have cased them in my frontmatter. (e.g., "iOS" should show up exactly like that, not "Ios" as the default theme displays it.

In taxonomy.html, if I change:

>{{ .Page.Title | title }}</a

to:

>{{ .Page.Title | lower }}</a

It will at least lowercase them all on my tag. I would think removing title/lower will default to the casing exactly as typed, but when I remove it, it defaults to showing it as titlecase.

Is there anywhere else I should look? I can't see anything in documentation unless I missed? Here's the example from my live site:

https://coefficiencies.com/tags/

@tommertron
Copy link
Contributor Author

So, interestingly, I did figure out that if I add titleCaseStyle = 'none' to my hugo.toml file, the tags now show up exactly as typed, but "topics" (a custom taxonomy term I added) show up in titlecase.

Here's an example of topics forcing to lowercase (they are typed in titlecase:)
https://coefficiencies.com/topics/

Tags are now showing up correctly as typed:
https://coefficiencies.com/tags/

On a post, tags are in case as typed, but topics show up as titlecase:

https://coefficiencies.com/posts/quick-posts-post-from-my-phone/

@tommertron tommertron changed the title Taxonomies Overriding Default Casting Taxonomies Overriding Default Casing Feb 24, 2025
@jpanther
Copy link
Owner

This is actually something that bugged me when I very first added the taxonomy listing pages but I never came back to take another look at it. I agree that by default they should show however you choose to name them.

A quick search on this suggests that it might not be a simple fix, but I'll try have a look into this when I have some spare time.

Some references:

@tommertron
Copy link
Contributor Author

Ah, so it might be that it's a Hugo thing, and not a Congo thing? The really odd thing is that the casing seems to apply differently for my "topics" vs. "tags" taxonomy, even though it looks like I've set them up in the exact same way.

@tommertron
Copy link
Contributor Author

Sorry, ignore my last comment. I wasn't consistently casing my topics. When I consistently case them it applies uniformly the way I've cased them all.

@whherui
Copy link

whherui commented Feb 26, 2025

Sorry, ignore my last comment. I wasn't consistently casing my topics. When I consistently case them it applies uniformly the way I've cased them all.

Hi, your website is awesome. I am planning to use the congo theme recently, but when I use the latest version of hugo (hugo_extended_withdeploy_0.144.2_linux-amd64.tar.gz
) to use the congo theme, the configuration file always reports an error. I am a devops engineer and I am not very good at front-end technology. Can you tell me which version of hugo you are using?

@tommertron
Copy link
Contributor Author

Hey, happy to help. Maybe just to keep this issue clean, reach out to me via my sites contact form?

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

No branches or pull requests

3 participants