-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Inconsistent use of camelCase when dealing with Viper & configuration data #1785
Comments
I don't think this is a bug. All of the keys are converted to lowercase prior to lookup by Viper. We may be inconsistent in using camelCase or TitleCase when we reference them in our |
@mdhender, |
Steve suggested that I create a test case to determine if this is Hugo or Viper. I'm planning on doing that this weekend. |
I've tried recreating it and running with the following test in
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I was trying to help @xiaomingplus with a themes question (https://discuss.gohugo.io/t/can-hugo-t-params-custom-a-directory/2481) and got confused on the way Hugo is using Viper. It looks like Viper is not case-sensitive, so things like ContentDir are spelled differently in different parts of the code.
This was really confusing since I thought that
SetDefault("ThemesDir", "themes")
in hugo/hugo.go would automatically pick up ThemesDir in the config file. If I change a line inhugolib/site.go
to use
ThemesDir
rather thanthemesDir
Hugo/Viper picks up the path like I'd expect. I think that it's a bug, but I don't know which part is the bug - Viper or Hugo.
The text was updated successfully, but these errors were encountered: