// Check that the drafts etc. are not built/processed/rendered.
assertShouldNotBuild(t, sites)
+ // en and nn have custom site menus
+ require.Len(t, frSite.Menus, 0, "fr: "+configSuffix)
+ require.Len(t, enSite.Menus, 1, "en: "+configSuffix)
+ require.Len(t, nnSite.Menus, 1, "nn: "+configSuffix)
+
+ require.Equal(t, "Home", enSite.Menus["main"].ByName()[0].Name)
+ require.Equal(t, "Heim", nnSite.Menus["main"].ByName()[0].Name)
+
}
func TestMultiSitesRebuild(t *testing.T) {
title = "English"
[Languages.en.blackfriday]
angledQuotes = false
+[[Languages.en.menu.main]]
+url = "/"
+name = "Home"
+weight = 0
[Languages.fr]
weight = 20
title = "Nynorsk"
[Languages.nn.Taxonomies]
lag = "lag"
+[[Languages.nn.menu.main]]
+url = "/"
+name = "Heim"
+weight = 1
[Languages.nb]
weight = 40
title: "English"
blackfriday:
angledQuotes: false
+ menu:
+ main:
+ - url: "/"
+ name: "Home"
+ weight: 0
fr:
weight: 20
title: "Français"
title: "Nynorsk"
Taxonomies:
lag: "lag"
+ menu:
+ main:
+ - url: "/"
+ name: "Heim"
+ weight: 1
nb:
weight: 40
title: "Bokmål"
"title": "English",
"blackfriday": {
"angledQuotes": false
+ },
+ "menu": {
+ "main": [
+ {
+ "url": "/",
+ "name": "Home",
+ "weight": 0
+ }
+ ]
}
},
"fr": {
"title": "Nynorsk",
"Taxonomies": {
"lag": "lag"
+ },
+ "menu": {
+ "main": [
+ {
+ "url": "/",
+ "name": "Heim",
+ "weight": 1
+ }
+ ]
}
},
"nb": {
ret := Menus{}
- if menus := viper.GetStringMap("menu"); menus != nil {
+ if menus := s.Language.GetStringMap("menu"); menus != nil {
for name, menu := range menus {
m, err := cast.ToSliceE(menu)
if err != nil {
}
}
- sectionPagesMenu := viper.GetString("SectionPagesMenu")
+ sectionPagesMenu := s.Language.GetString("SectionPagesMenu")
sectionPagesMenus := make(map[string]interface{})
//creating flat hash
for _, p := range s.Pages {