Revert "hugolib: Add terms' pages to .Data.Pages"
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 25 Feb 2017 17:14:48 +0000 (18:14 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 25 Feb 2017 17:14:48 +0000 (18:14 +0100)
This reverts commit e117b1b2c7d18f25e1b7094fd7edb5e12721b79d.

Will have to think a little about this.

hugolib/page.go
hugolib/taxonomy_test.go

index e06fa76b4eefbbb2fdfb8c8dd49473c4e63cd3ed..455efd7828b33460a6aba2fda049b0eab2599a89 100644 (file)
@@ -1595,17 +1595,10 @@ func (p *Page) prepareData(s *Site) error {
        case KindTaxonomyTerm:
                plural := p.sections[0]
                singular := s.taxonomiesPluralSingular[plural]
-               terms := s.Taxonomies[plural]
-
-               for _, tax := range terms {
-                       pages = append(pages, tax.Pages()...)
-               }
-
-               pages = pages.ByWeight()
 
                p.Data["Singular"] = singular
                p.Data["Plural"] = plural
-               p.Data["Terms"] = terms
+               p.Data["Terms"] = s.Taxonomies[plural]
                // keep the following just for legacy reasons
                p.Data["OrderedIndex"] = p.Data["Terms"]
                p.Data["Index"] = p.Data["Terms"]
index 919c3a55848caf7f4eeb97df565d549187431acc..f23693403314f95756529a11e5eee58084b8448f 100644 (file)
@@ -124,15 +124,6 @@ others:
        th.assertFileContent("public/others/index.html", "Terms List", "Others")
 
        s := h.Sites[0]
-       cat1 := s.getPage(KindTaxonomy, "categories", "cat1")
-       require.NotNil(t, cat1)
-       require.Len(t, cat1.Pages, 2)
-
-       cat := s.getPage(KindTaxonomyTerm, "categories")
-       require.NotNil(t, cat)
-       require.Len(t, cat.Pages, 3)
-       require.Len(t, cat.Data["Pages"], 3)
-       require.Equal(t, "t1/c1", cat.Pages[0].Title)
 
        // Issue #3070 preserveTaxonomyNames
        if preserveTaxonomyNames {