Add JSON config to the multilanguage testing
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 10 Aug 2016 21:57:10 +0000 (23:57 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 6 Sep 2016 15:32:20 +0000 (18:32 +0300)
Updates #2309

hugolib/hugo_sites_test.go

index c5a226dc21162fbaa67430cfb2c44b5be4fc1429..50ee1ee721b7f87e1802b00b14bd3a2400994c9f 100644 (file)
@@ -168,6 +168,7 @@ func TestMultiSitesBuild(t *testing.T) {
        }{
                {multiSiteTomlConfig, "toml"},
                {multiSiteYAMLConfig, "yml"},
+               {multiSiteJSONConfig, "json"},
        } {
                doTestMultiSitesBuild(t, config.content, config.suffix)
        }
@@ -654,6 +655,57 @@ Languages:
 
 `
 
+var multiSiteJSONConfig = `
+{
+  "DefaultExtension": "html",
+  "baseurl": "http://example.com/blog",
+  "DisableSitemap": false,
+  "DisableRSS": false,
+  "RSSUri": "index.xml",
+  "paginate": 1,
+  "DefaultContentLanguage": "fr",
+  "permalinks": {
+    "other": "/somewhere/else/:filename"
+  },
+  "blackfriday": {
+    "angledQuotes": true
+  },
+  "Taxonomies": {
+    "tag": "tags"
+  },
+  "Languages": {
+    "en": {
+      "weight": 10,
+      "title": "English",
+      "blackfriday": {
+        "angledQuotes": false
+      }
+    },
+    "fr": {
+      "weight": 20,
+      "title": "Français",
+      "Taxonomies": {
+        "plaque": "plaques"
+      }
+    },
+    "nn": {
+      "weight": 30,
+      "title": "Nynorsk",
+      "Taxonomies": {
+        "lag": "lag"
+      }
+    },
+    "nb": {
+      "weight": 40,
+      "title": "Bokmål",
+      "Taxonomies": {
+        "lag": "lag"
+      }
+    }
+  }
+}
+`
+
 func createMultiTestSites(t *testing.T, tomlConfig string) *HugoSites {
        return createMultiTestSitesForConfig(t, tomlConfig, "toml")
 }