mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
hugolib, output: Fix RSSLink vs output formats
And remove the now superflous setPageURLs method.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user