diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..8fdc5c4 --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,52 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} — {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + {{ if ne .Title .Site.Title }}{{ with .Title }}{{ . }} — {{ end }}{{ end }}{{ .Site.Params.description }} + Hugo + en-ie + {{ .Site.Params.organizerName }} + {{ .Site.Params.email }} ({{ .Site.Params.organizerName }}) + {{ .Site.Params.email }} ({{ .Site.Params.organizerName }}) + {{- with .OutputFormats.Get "RSS" }} + + {{- end }} + {{- if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- end }} + {{- with .Site.Params.ogImage }} + + {{ . | absURL }} + {{ $.Site.Title }} + {{ $.Site.BaseURL }} + + {{- end }} + {{- range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ $.Site.Params.organizerName }} + {{ with .Description }}{{ . | html }}{{ end }} + {{ printf "" .Content | safeHTML }} + + {{- end }} + + diff --git a/layouts/blog/list.html b/layouts/blog/list.html index cbff482..1f659c4 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -5,6 +5,16 @@

{{ .Title }}

{{ .Description }}

+ {{- with .OutputFormats.Get "RSS" }} +
+ + + RSS Feed + +
+ {{- end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index dcd4613..97f8029 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -56,5 +56,16 @@ +{{/* RSS autodiscovery */}} +{{- if eq .Section "blog" }} + {{- with .OutputFormats.Get "RSS" }} + + {{- end }} +{{- else if .IsHome }} + {{- with .OutputFormats.Get "RSS" }} + + {{- end }} +{{- end }} + {{/* Structured Data / Schema.org */}} {{ partial "structured-data.html" . }}