razonyang / hugo-theme-bootstrap

A fast, responsive, multipurpose and feature-rich Hugo theme.
https://hbs.razonyang.com
MIT License
495 stars 169 forks source link

Change all references to titles to title case #134

Closed Monklite closed 3 years ago

Monklite commented 3 years ago

I think it would be good to make all references to titles as title case; for example, if the title of a .md file is "My trip to the beach", it would be displayed just like that as opposed to the title case format of "My Trip to the Beach".

References to the title should include anything in the list.html layout as well as anything on the sidebar such as recent posts and featured. It would also apply to the buttons in the post.html that let you navigate forwards and backwards between posts since it displays the title name.

If you want, I could do a PR and edit the html directly to accommodate this or I could arrange it such that the proposed title case format is dependent on a parameter in the config files so the choice is left to the user. Which would you prefer and is this something you would prefer to do or would you accept this PR?

Thanks!

razonyang commented 3 years ago

Sounds good. PR are welcome. I prefer to provide a parameter, disabled by default.

But I have no idea how to name the parameter. I'm looking forward to your PR.

Monklite commented 3 years ago

I will just name it titleCase. I'll put it under config.toml and will disable it by default as you requested.

razonyang commented 3 years ago

I will just name it titleCase. I'll put it under config.toml and will disable it by default as you requested.

Literally, does titleCase have multiple values? Such as lowercase and uppercase?

Monklite commented 3 years ago

I will just name it titleCase. I'll put it under config.toml and will disable it by default as you requested.

Literally, does titleCase have multiple values? Such as lowercase and uppercase?

It has multiple values. "Set titleCaseStyle to specify the title style used by the title template function and the automatic section titles in Hugo. It defaults to AP Stylebook for title casing, but you can also set it to Chicago or Go (every word starts with a capital letter)."

Full uppercase or full lowercase is something that can be done with CSS, I don't think that applies to title case options in Hugo. Does that make sense?

Monklite commented 3 years ago

I'll work on the PR now and have it submitted today.

razonyang commented 3 years ago

I didn't know the titleCaseStyle before, thanks for letting me know. I'm looking forward to your submission.

Monklite commented 3 years ago

It's almost done; however, I am having a tough time getting it to work properly with bread crumb trails as well as search lists. It seems to work fine for every other list/reference to a title. Do you want me to submit it anyways?

razonyang commented 3 years ago

Yep. Thanks for your work, please make a PR, I'll take care of the rest.

Monklite commented 3 years ago

Yep. Thanks for your work, please make a PR, I'll take care of the rest.

Will do in a bit. Check out the breadcrumbs (I modified breadcrumb.html) and the search results (did not modify search.html

razonyang commented 3 years ago

and the search results (did not modify search.html

Kind remind: https://github.com/razonyang/hugo-theme-bootstrap/blob/32bcbee9bc916c9354c72adf09e82923668cfebc/layouts/index.json#L4

Modify this line may help.

Monklite commented 3 years ago

Closing due to #136