lxndrblz / anatole

Anatole is a minimalistic two-column theme for Hugo.
https://themes.gohugo.io/themes/anatole/
MIT License
651 stars 363 forks source link

Disable title capitalization #368

Closed McPringle closed 1 month ago

McPringle commented 2 years ago

Is your feature request related to a problem? Please describe. In some languages using capitalization of titles looks awesome because they have strict rules and capitalization is not a style, but a meaning (e.g. capitalized words are nouns).

Describe the solution you'd like Please don't use the "title" processor in the template file. Use CSS instead. That makes it much easier to change the capitalization as wanted:

text-transform: capitalize

As a user of your theme I will now be able to override the CSS style to disable capitalization if I need to:

text-transform: none

Describe alternatives you've considered I can provide my own single.html file. But when I do it, I have to monitor your changes in your single.html and merge them with my modifications. I prefer to use the CSS solution instead.

Additional context Add any other context or screenshots about the feature request here.

ericswpark commented 2 years ago

@McPringle just to confirm, you want to disable the capitalization of titles in the post list, right? I had to make this change too and found that this temporary workaround helped:

assets/css/list-title.css:

.archive__list-title {
     text-transform: none;
 } 

config.toml:

customCss = ["css/list-title.css"]

While this works it would be great if we could turn off capitalization in the configuration.

McPringle commented 2 years ago

Sorry, no, I want to disable it on the single page, not in the lists.

lxndrblz commented 2 years ago

@McPringle Would you mind opening a PR with the proposed change?

I agree with your suggestions. Especially in German capitalization matters.

McPringle commented 2 years ago

Next week we are doing a Hackergarten in Lucerne and I'll suggest this issue as a topic.

lxndrblz commented 2 years ago

@McPringle Were you able to work on it as part of your hackathon?

ericswpark commented 1 year ago

I just realized what @McPringle meant by the capitalization problem and once I noticed it I really wish we could turn it off, as it mangles some of my blog post titles.

@lxndrblz could we make it an option to disable title capitalization in single pages?

McPringle commented 1 year ago

Unfortunately, this issue was not picked up at the Hackergarten. But winter is coming with more evenings at home... ;-)

ericswpark commented 1 year ago

@lxndrblz @McPringle just drafted a rough commit that adds a configuration option for single page titles.

I was also thinking about having the config option change the archive (list) title capitalization as well since I'd like to turn that off too but I realized that one is in all caps, so it's more of a stylistic choice? So either:

a) change the configuration option name to disableTitleStyling and have it disable all title styling (dunno how that would work on scss files though) or b) change this configuration option name to disableSinglePageTitleCapitalization and create a separate, new PR for disableArchiveTitleStyling or something like that. (Maybe the config name is too long. Or not.)

McPringle commented 1 year ago

Fantastic! For me variant b) would be enough, but variant a) would be fine, too. :-)

McPringle commented 2 weeks ago

Thank you very much, the new config options work on my updated blog like a charm!