Render main content language in root by default

Fixes #2312
This commit is contained in:
Bjørn Erik Pedersen 2016-08-08 13:55:18 +02:00
parent d953e39e63
commit 8da040342e
12 changed files with 296 additions and 129 deletions

View file

@ -14,13 +14,12 @@
package hugolib
import (
"bytes"
"testing"
"reflect"
"strings"
"github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/hugofs"
"github.com/spf13/hugo/source"
"github.com/spf13/viper"
)
@ -50,15 +49,10 @@ func TestSitemapOutput(t *testing.T) {
t.Fatalf("Failed to build site: %s", err)
}
sitemapFile, err := hugofs.Destination().Open("public/sitemap.xml")
sitemapContent := readDestination(t, "public/sitemap.xml")
if err != nil {
t.Fatalf("Unable to locate: sitemap.xml")
}
sitemap := helpers.ReaderToBytes(sitemapFile)
if !bytes.HasPrefix(sitemap, []byte("<?xml")) {
t.Errorf("Sitemap file should start with <?xml. %s", sitemap)
if !strings.HasPrefix(sitemapContent, "<?xml") {
t.Errorf("Sitemap file should start with <?xml. %s", sitemapContent)
}
}