mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Create a struct with all of Hugo's config options
Primary motivation is documentation, but it will also hopefully simplify the code. Also, * Lower case the default output format names; this is in line with the custom ones (map keys) and how it's treated all the places. This avoids doing `stringds.EqualFold` everywhere. Closes #10896 Closes #10620
This commit is contained in:
@@ -91,7 +91,7 @@ func TestCardinalityThreshold(t *testing.T) {
|
||||
config := Config{
|
||||
Threshold: 90,
|
||||
IncludeNewer: false,
|
||||
Indices: IndexConfigs{
|
||||
Indices: IndicesConfig{
|
||||
IndexConfig{Name: "tags", Weight: 50, CardinalityThreshold: 79},
|
||||
IndexConfig{Name: "keywords", Weight: 65, CardinalityThreshold: 90},
|
||||
},
|
||||
@@ -125,7 +125,7 @@ func TestSearch(t *testing.T) {
|
||||
config := Config{
|
||||
Threshold: 90,
|
||||
IncludeNewer: false,
|
||||
Indices: IndexConfigs{
|
||||
Indices: IndicesConfig{
|
||||
IndexConfig{Name: "tags", Weight: 50},
|
||||
IndexConfig{Name: "keywords", Weight: 65},
|
||||
},
|
||||
@@ -293,7 +293,7 @@ func BenchmarkRelatedNewIndex(b *testing.B) {
|
||||
|
||||
cfg := Config{
|
||||
Threshold: 50,
|
||||
Indices: IndexConfigs{
|
||||
Indices: IndicesConfig{
|
||||
IndexConfig{Name: "tags", Weight: 100},
|
||||
IndexConfig{Name: "keywords", Weight: 200},
|
||||
},
|
||||
@@ -334,7 +334,7 @@ func BenchmarkRelatedMatchesIn(b *testing.B) {
|
||||
|
||||
cfg := Config{
|
||||
Threshold: 20,
|
||||
Indices: IndexConfigs{
|
||||
Indices: IndicesConfig{
|
||||
IndexConfig{Name: "tags", Weight: 100},
|
||||
IndexConfig{Name: "keywords", Weight: 200},
|
||||
},
|
||||
|
Reference in New Issue
Block a user