hugolib, output: Fix RSSLink vs output formats

And remove the now superflous setPageURLs method.
This commit is contained in:
Bjørn Erik Pedersen
2017-03-24 16:54:37 +01:00
parent 87188496fb
commit 5761b93c96
6 changed files with 23 additions and 23 deletions

View File

@@ -20,7 +20,6 @@ import (
"io"
"net/url"
"os"
"path"
"path/filepath"
"strconv"
"strings"
@@ -2054,19 +2053,9 @@ func (s *Site) newHomePage() *Page {
pages := Pages{}
p.Data["Pages"] = pages
p.Pages = pages
s.setPageURLs(p, "/")
return p
}
// TODO(bep) output
func (s *Site) setPageURLs(p *Page, in string) {
p.URLPath.URL = s.PathSpec.URLizeAndPrep(in)
p.URLPath.Permalink = s.permalink(p.URLPath.URL)
if p.Kind != KindPage {
p.RSSLink = template.URL(s.permalink(p.URLPath.URL + ".xml"))
}
}
func (s *Site) newTaxonomyPage(plural, key string) *Page {
p := s.newNodePage(KindTaxonomy, plural, key)
@@ -2081,8 +2070,6 @@ func (s *Site) newTaxonomyPage(plural, key string) *Page {
p.Title = strings.Replace(strings.Title(key), "-", " ", -1)
}
s.setPageURLs(p, path.Join(plural, key))
return p
}
@@ -2100,13 +2087,11 @@ func (s *Site) newSectionPage(name string, section WeightedPages) *Page {
} else {
p.Title = sectionName
}
s.setPageURLs(p, name)
return p
}
func (s *Site) newTaxonomyTermsPage(plural string) *Page {
p := s.newNodePage(KindTaxonomyTerm, plural)
p.Title = strings.Title(plural)
s.setPageURLs(p, plural)
return p
}