summaryrefslogtreecommitdiffstats
path: root/hugolib/page.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-24 16:54:37 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-27 15:43:56 +0200
commit5761b93c96e89a1e269156c179841301e5808fad (patch)
treee587df59eadc45a2ab86c86c65a2956d1812b961 /hugolib/page.go
parent87188496fbb68c39567ec3ee3a55a9305a13e48b (diff)
hugolib, output: Fix RSSLink vs output formats
And remove the now superflous setPageURLs method.
Diffstat (limited to 'hugolib/page.go')
-rw-r--r--hugolib/page.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/hugolib/page.go b/hugolib/page.go
index dba3942de..36c89d958 100644
--- a/hugolib/page.go
+++ b/hugolib/page.go
@@ -184,8 +184,6 @@ type Page struct {
Sitemap Sitemap
- RSSLink template.URL
-
URLPath
permalink string
relPermalink string
@@ -210,6 +208,14 @@ type Page struct {
targetPathDescriptorPrototype *targetPathDescriptor
}
+func (p *Page) RSSLink() template.URL {
+ f, found := p.outputFormats.GetByName(output.RSSType.Name)
+ if !found {
+ return ""
+ }
+ return template.URL(newOutputFormat(p, f).Permalink())
+}
+
func (p *Page) createLayoutDescriptor() output.LayoutDescriptor {
var section string
@@ -1541,7 +1547,7 @@ func (p *Page) RSSlink() template.URL {
// TODO(bep) we cannot have two of these
// Remove in Hugo 0.20
helpers.Deprecated(".Page", "RSSlink", "Use RSSLink", true)
- return p.RSSLink
+ return p.RSSLink()
}
func (p *Page) Ref(ref string) (string, error) {