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

Make the title func follow some style guide #989

Closed
bep opened this Issue Mar 20, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@bep
Member

bep commented Mar 20, 2015

This template func could be very useful, if it was done properly.

Right now it title cases first char of each word.

So

This is a title => "This Is A Title"

From the doc:

// Title returns a copy of the string s with all Unicode letters that begin words
// mapped to their title case.

Have a look at http://titlecapitalization.com/

Pick a style, but it would cool if AP style was the default, then add an option for the other two.

Do not underestimate the importance of this.

@anthonyfok - you are the style guide / copy edit expert in here. What do you think? I can implement this if more people than me thinks it is important ...

@bep bep added the Enhancement label Mar 20, 2015

@EricR

This comment has been minimized.

Show comment
Hide comment
@EricR

EricR Mar 24, 2015

I think this would be useful 👍

EricR commented Mar 24, 2015

I think this would be useful 👍

@anthonyfok

This comment has been minimized.

Show comment
Hide comment
@anthonyfok

anthonyfok Mar 25, 2015

Contributor

@bep: Hoho! You are flattering me! I am no expert. ;-)

But yes, I think what you suggest would be a great thing to have.
Hugo docs used to use text-transform: capitalize for the sidebar menu,
and having "Of", "The" etc. capitalized was very disconcerting,
hence commit 769ab9e.

The only concern I have is that languages other than English may have different styles/rules. For example, it seems to me that French titles tend to use "sentence case" rather than "title case". But I think I am worrying too much. ;-)

English is most likely the most-used language for Hugo and for any static website generator / CMS out there, so I'd say it is a very valuable feature and a noble effort. Thank you for taking this initiative!

Contributor

anthonyfok commented Mar 25, 2015

@bep: Hoho! You are flattering me! I am no expert. ;-)

But yes, I think what you suggest would be a great thing to have.
Hugo docs used to use text-transform: capitalize for the sidebar menu,
and having "Of", "The" etc. capitalized was very disconcerting,
hence commit 769ab9e.

The only concern I have is that languages other than English may have different styles/rules. For example, it seems to me that French titles tend to use "sentence case" rather than "title case". But I think I am worrying too much. ;-)

English is most likely the most-used language for Hugo and for any static website generator / CMS out there, so I'd say it is a very valuable feature and a noble effort. Thank you for taking this initiative!

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 25, 2015

Member

I'm from Norway, and we have no title case ...

Member

bep commented Mar 25, 2015

I'm from Norway, and we have no title case ...

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 1, 2017

Member

Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.

If this is a bug and you can still reproduce this error on the latest release or the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

Member

bep commented Mar 1, 2017

Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.

If this is a bug and you can still reproduce this error on the latest release or the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

@bep bep closed this Mar 27, 2017

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Mar 28, 2017

Contributor

I'd not say it is a bug, but... "This Is A Title" just looks terrible, although English is not my native language. I don't care which style to use, but any style would be significantly better than no style at all.

My actual use case is to display all category names of a site, and I'm in a dilemma. If I use preserveTaxonomyNames = true, I get ugly URLs (e.g. /categories/This is a Category/); if I set it to false (default), I get ugly names for humans (this-is-a-category). In the latter case, I could use string | humanize | title, but it gives me "This Is A Category". If only the original category names were stored and accessible from .Site.Taxonomies.categories...

Contributor

yihui commented Mar 28, 2017

I'd not say it is a bug, but... "This Is A Title" just looks terrible, although English is not my native language. I don't care which style to use, but any style would be significantly better than no style at all.

My actual use case is to display all category names of a site, and I'm in a dilemma. If I use preserveTaxonomyNames = true, I get ugly URLs (e.g. /categories/This is a Category/); if I set it to false (default), I get ugly names for humans (this-is-a-category). In the latter case, I could use string | humanize | title, but it gives me "This Is A Category". If only the original category names were stored and accessible from .Site.Taxonomies.categories...

@bep bep reopened this Jul 30, 2017

@bep bep self-assigned this Jul 30, 2017

@bep bep removed the Stale label Jul 30, 2017

@bep bep added this to the v0.26 milestone Jul 30, 2017

bep added a commit to bep/hugo that referenced this issue Jul 30, 2017

bep added a commit to bep/hugo that referenced this issue Jul 30, 2017

bep added a commit to bep/hugo that referenced this issue Jul 30, 2017

Make the title case style guide configurable
* AP style (new default)
* Chicago style
} Go style (what we have today)

Fixes #989

bep added a commit to bep/hugo that referenced this issue Jul 30, 2017

Make the title case style guide configurable
* AP style (new default)
* Chicago style
* Go style (what we have today)

Fixes #989

bep added a commit to bep/hugo that referenced this issue Jul 30, 2017

Make the title case style guide configurable
* AP style (new default)
* Chicago style
* Go style (what we have today)

Fixes #989

bep added a commit to bep/hugo that referenced this issue Jul 31, 2017

Make the title case style guide configurable
This works for the `title` func and the other places where Hugo makes title case.

* AP style (new default)
* Chicago style
* Go style (what we have today)

Fixes #989

bep added a commit to bep/hugo that referenced this issue Jul 31, 2017

Make the title case style guide configurable
This works for the `title` func and the other places where Hugo makes title case.

* AP style (new default)
* Chicago style
* Go style (what we have today)

Fixes #989

@bep bep closed this in #3753 Jul 31, 2017

bep added a commit that referenced this issue Jul 31, 2017

Make the title case style guide configurable
This works for the `title` func and the other places where Hugo makes title case.

* AP style (new default)
* Chicago style
* Go style (what we have today)

Fixes #989
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment