From 8d5132229f7b12aef2483d19ed3c7fdc5c2b6a91 Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Sat, 25 Feb 2017 17:12:08 -0600 Subject: [PATCH] docs: Update RSS docs with rssLimit changes Side effect: remove unnecessary XML templates from example blog site. Fixes #3065 --- docs/content/templates/rss.md | 13 +++++++++---- examples/blog/layouts/rss.xml | 20 -------------------- examples/blog/layouts/sitemap.xml | 10 ---------- 3 files changed, 9 insertions(+), 34 deletions(-) delete mode 100644 examples/blog/layouts/rss.xml delete mode 100644 examples/blog/layouts/sitemap.xml diff --git a/docs/content/templates/rss.md b/docs/content/templates/rss.md index 32c8f349b..d390b4306 100644 --- a/docs/content/templates/rss.md +++ b/docs/content/templates/rss.md @@ -58,24 +58,29 @@ If the following values are specified in the site’s config file (`config.toml` [author] name = "My Name Here" + email = "sample@domain.tld" +### Limiting the Number of Items + +By default, the RSS feed is limited to **15** items. +You may override the default by using the `rssLimit` [site configuration variable](/overview/configuration/). ## The Embedded rss.xml This is the default RSS template that ships with Hugo. It adheres to the [RSS 2.0 Specification][RSS 2.0]. - {{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }} + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} {{ .Permalink }} - Recent content {{ with .Title }}in {{.}} {{ end }}on {{ .Site.Title }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} Hugo -- gohugo.io{{ with .Site.LanguageCode }} {{.}}{{end}}{{ with .Site.Author.email }} {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - - {{ range first 15 .Data.Pages }} + + {{ range .Data.Pages }} {{ .Title }} {{ .Permalink }} diff --git a/examples/blog/layouts/rss.xml b/examples/blog/layouts/rss.xml deleted file mode 100644 index 7cb7568a6..000000000 --- a/examples/blog/layouts/rss.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - {{ .Title }} on {{ .Site.Title }} - {{ .Permalink }} - en-US - Enthusiastic Hugo User - Copyright (c) 2014, Enthusiastic Hugo User; all rights reserved. - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }} - {{ range first 15 .Data.Pages }} - - {{ .Title }} - {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }} - Enthusiastic Hugo User - {{ .Permalink }} - {{ .Content | html }} - - {{ end }} - - \ No newline at end of file diff --git a/examples/blog/layouts/sitemap.xml b/examples/blog/layouts/sitemap.xml deleted file mode 100644 index 005824255..000000000 --- a/examples/blog/layouts/sitemap.xml +++ /dev/null @@ -1,10 +0,0 @@ - - {{ range .Data.Pages }} - - {{ .Permalink }}{{ if not .Lastmod.IsZero }} - {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} - {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} - {{ .Sitemap.Priority }}{{ end }} - - {{ end }} -