diff options
author | Bjørn Erik Pedersen <[email protected]> | 2020-02-18 16:55:30 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-02-18 16:55:30 +0100 |
commit | aa3e1830568cabaa8bf3277feeba6cb48746e40c (patch) | |
tree | 7b769afc62bdec695a6999746d4d9e71db251f86 | |
parent | 1b7acfe7634a5d7bbc597ef4dddf4babce5666c5 (diff) | |
download | hugo-aa3e1830568cabaa8bf3277feeba6cb48746e40c.tar.gz hugo-aa3e1830568cabaa8bf3277feeba6cb48746e40c.zip |
tpl: Fix RSS template for the terms listing
Fixes #6909
-rw-r--r-- | hugolib/taxonomy_test.go | 2 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 7 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/_default/rss.xml | 7 |
3 files changed, 13 insertions, 3 deletions
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go index abe4b97cd..6d049a0c3 100644 --- a/hugolib/taxonomy_test.go +++ b/hugolib/taxonomy_test.go @@ -561,6 +561,6 @@ categories: ["funny"] b.Assert(funny.Parent(), qt.Equals, cat) b.AssertFileContent("public/categories/funny/index.xml", `<link>http://example.com/p/</link>`) - // TODO https://github.com/gohugoio/hugo/issues/6909 b.AssertFileContent("public/categories/index.xml", `<link>http://example.com/categories/funny/</link>`) + b.AssertFileContent("public/categories/index.xml", `<link>http://example.com/categories/funny/</link>`) } diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index f64f18ee1..c9dec8988 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -21,7 +21,12 @@ var EmbeddedTemplates = [][2]string{ {`_default/robots.txt`, `User-agent: *`}, {`_default/rss.xml`, `{{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := $pctx.RegularPages -}} +{{- $pages := slice -}} +{{- if eq $.Kind "taxonomyTerm" -}} +{{- $pages = $pctx.Pages -}} +{{- else -}} +{{- $pages = $pctx.RegularPages -}} +{{- end -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} diff --git a/tpl/tplimpl/embedded/templates/_default/rss.xml b/tpl/tplimpl/embedded/templates/_default/rss.xml index 3e17f48c6..5ec2025b6 100644 --- a/tpl/tplimpl/embedded/templates/_default/rss.xml +++ b/tpl/tplimpl/embedded/templates/_default/rss.xml @@ -1,6 +1,11 @@ {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := $pctx.RegularPages -}} +{{- $pages := slice -}} +{{- if eq $.Kind "taxonomyTerm" -}} +{{- $pages = $pctx.Pages -}} +{{- else -}} +{{- $pages = $pctx.RegularPages -}} +{{- end -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} |