From b21642366e376711bae0f0caa2d8f065590748f5 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Tue, 13 Sep 2016 01:43:47 +0100 Subject: [PATCH] Add RSS feed --- layouts/partials/header.html | 5 ++++- layouts/rss.xml | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 layouts/rss.xml diff --git a/layouts/partials/header.html b/layouts/partials/header.html index b679acfe..cf8763c8 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -20,7 +20,10 @@ {{ end }} - + {{ if .RSSlink }} + + + {{ end }} diff --git a/layouts/rss.xml b/layouts/rss.xml new file mode 100644 index 00000000..60b670a1 --- /dev/null +++ b/layouts/rss.xml @@ -0,0 +1,24 @@ + + + {{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }} + {{ .Permalink }} + Recent content {{ with .Title }}in {{.}} {{ 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 (where .Data.Pages "Type" "!=" "home") }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Content | html }} + + {{ end }} + +