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

all: Unify case of config variable names #2571

Merged
merged 1 commit into from
Oct 24, 2016
Merged

all: Unify case of config variable names #2571

merged 1 commit into from
Oct 24, 2016

Conversation

n10v
Copy link
Contributor

@n10v n10v commented Oct 13, 2016

All config variables start with low-case and use camelCase.

If there is abbreviation at the beginning of the name, the whole abbreviation will
be written in low-case
If there is abbreviation at the end of the name, the whole abbreviation will
be written in upper-case.
For example, rssURI.

Also, the performance will be better, because viper lowers case of keys with function strings.ToLower, which calls strings.Map(unicode.ToLower, str) and this function works so, what the later there will be upper-case rune, the faster it will work.

Conversation: https://discuss.gohugo.io/t/viper-why-hugo-sets-keys-in-upper-case

@n10v n10v force-pushed the lowcase branch 2 times, most recently from f2a6d4e to 3015f78 Compare October 22, 2016 07:22
@n10v
Copy link
Contributor Author

n10v commented Oct 22, 2016

Any questions or offers?

@bep
Copy link
Member

bep commented Oct 22, 2016

Any questions or offers?

No. I'm just waiting to merge a potential conflicting PR, that's all.

@n10v
Copy link
Contributor Author

n10v commented Oct 22, 2016

Ok

@bep
Copy link
Member

bep commented Oct 24, 2016

And I was right. a10b2cd created some conflicts in this PR. Sorry for dumping this in your lap, so to speak, but I just had to get that commit just right without too much distractions.

If you do a rebase master on this branch you will get the same conflicts.

@n10v
Copy link
Contributor Author

n10v commented Oct 24, 2016

No problem. I will solve it now

All config variables starts with low-case and uses camelCase.

If there is abbreviation at the beginning of the name, the whole
abbreviation will be written in low-case.
If there is abbreviation at the end of the name, the
whole abbreviation will be written in upper-case.
For example, rssURI.
@n10v
Copy link
Contributor Author

n10v commented Oct 24, 2016

Solved

@bep bep merged commit f21e2f2 into gohugoio:master Oct 24, 2016
@bep
Copy link
Member

bep commented Oct 24, 2016

Thanks for this, it looks so much better now.

@digitalcraftsman the docs got a cleanup of this, too. I'm not aware of any functional changes since Hugo 0.17 -- maybe we should just rebase the docs branch against master?

@n10v n10v deleted the lowcase branch October 24, 2016 18:57
@digitalcraftsman
Copy link
Member

@digitalcraftsman the docs got a cleanup of this, too. I'm not aware of any functional changes since Hugo 0.17 -- maybe we should just rebase the docs branch against master?

This would be a good idea. I would rather preferring to cherrypick this single commit in order to minimize merge conflicts.

@github-actions
Copy link

This pull request 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 Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants