mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
all: Unify case of config variable names
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.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
d9f54a13c1
commit
f21e2f25c9
@@ -62,10 +62,10 @@ func TestAbsURL(t *testing.T) {
|
||||
|
||||
func doTestAbsURL(t *testing.T, defaultInSubDir, addLanguage, multilingual bool, lang string) {
|
||||
viper.Reset()
|
||||
viper.Set("Multilingual", multilingual)
|
||||
viper.Set("CurrentContentLanguage", NewLanguage(lang))
|
||||
viper.Set("DefaultContentLanguage", "en")
|
||||
viper.Set("DefaultContentLanguageInSubdir", defaultInSubDir)
|
||||
viper.Set("multilingual", multilingual)
|
||||
viper.Set("currentContentLanguage", NewLanguage(lang))
|
||||
viper.Set("defaultContentLanguage", "en")
|
||||
viper.Set("defaultContentLanguageInSubdir", defaultInSubDir)
|
||||
|
||||
tests := []struct {
|
||||
input string
|
||||
@@ -86,7 +86,7 @@ func doTestAbsURL(t *testing.T, defaultInSubDir, addLanguage, multilingual bool,
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
viper.Set("BaseURL", test.baseURL)
|
||||
viper.Set("baseURL", test.baseURL)
|
||||
p := NewPathSpecFromConfig(viper.GetViper())
|
||||
output := p.AbsURL(test.input, addLanguage)
|
||||
expected := test.expected
|
||||
@@ -136,10 +136,10 @@ func TestRelURL(t *testing.T) {
|
||||
|
||||
func doTestRelURL(t *testing.T, defaultInSubDir, addLanguage, multilingual bool, lang string) {
|
||||
viper.Reset()
|
||||
viper.Set("Multilingual", multilingual)
|
||||
viper.Set("CurrentContentLanguage", NewLanguage(lang))
|
||||
viper.Set("DefaultContentLanguage", "en")
|
||||
viper.Set("DefaultContentLanguageInSubdir", defaultInSubDir)
|
||||
viper.Set("multilingual", multilingual)
|
||||
viper.Set("currentContentLanguage", NewLanguage(lang))
|
||||
viper.Set("defaultContentLanguage", "en")
|
||||
viper.Set("defaultContentLanguageInSubdir", defaultInSubDir)
|
||||
|
||||
tests := []struct {
|
||||
input string
|
||||
@@ -162,7 +162,7 @@ func doTestRelURL(t *testing.T, defaultInSubDir, addLanguage, multilingual bool,
|
||||
}
|
||||
|
||||
for i, test := range tests {
|
||||
viper.Set("BaseURL", test.baseURL)
|
||||
viper.Set("baseURL", test.baseURL)
|
||||
viper.Set("canonifyURLs", test.canonify)
|
||||
p := NewPathSpecFromConfig(viper.GetViper())
|
||||
|
||||
|
Reference in New Issue
Block a user