node to page: Handle translations

Updates #2297
This commit is contained in:
Bjørn Erik Pedersen
2016-11-07 20:24:37 +01:00
parent 698b994f71
commit ec2d502b4f
12 changed files with 445 additions and 155 deletions

View File

@@ -14,7 +14,7 @@
package hugolib
import (
"strings"
"path/filepath"
"testing"
"github.com/spf13/viper"
@@ -30,10 +30,13 @@ func TestByCountOrderOfTaxonomies(t *testing.T) {
viper.Set("taxonomies", taxonomies)
writeSource(t, filepath.Join("content", "page.md"), pageYamlWithTaxonomiesA)
site := newSiteDefaultLang()
page, _ := NewPageFrom(strings.NewReader(pageYamlWithTaxonomiesA), "path/to/page")
site.Pages = append(site.Pages, page)
site.assembleTaxonomies()
if err := buildSiteSkipRender(site); err != nil {
t.Fatalf("Failed to build site: %s", err)
}
st := make([]string, 0)
for _, t := range site.Taxonomies["tags"].ByCount() {