Let the main rss feed show all kinds of posts

alternate-navbar
Maik de Kruif 3 years ago
parent ba34adc634
commit e4e47994a1
Signed by: maik
GPG Key ID: 44A55AD1F0673FA6
  1. 27
      themes/maik-blog/layouts/rss.xml

@ -19,22 +19,33 @@
{{- if not .Date.IsZero }} {{- if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate> <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
{{- end }} {{- end }}
{{- with .OutputFormats.Get "RSS" -}} {{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }} {{- end }}
{{- range .Pages }} {{- $allContent := slice }}
{{- range .Site.Sections }}
{{- $allContent = union $allContent .Pages }}
{{- end }}
<br/>
{{- $allContent = sort $allContent "Date" "desc" }}
{{- $allContent = $allContent | first 15 }}
{{- range $allContent }}
<item> <item>
<title>{{ .Title }}</title> <title>{{ .Title }}{{ with .Params.Subtitle }} // {{ . }}{{ end }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<published>{{ .Date.Format "2006-01-02T15:04:05Z0700" | safeHTML }}</published> <published>{{ .Date.Format "2006-01-02T15:04:05Z0700" | safeHTML }}</published>
{{- if .GitInfo }} {{- if .GitInfo }}
<updated>{{ dateFormat "2006-01-02T15:04:05Z0700" .GitInfo.AuthorDate.Local | safeHTML }}</updated> <updated>{{ dateFormat "2006-01-02T15:04:05Z0700" .GitInfo.AuthorDate.Local | safeHTML }}</updated>
{{- end }} {{- end }}
<author>{{ .Site.Author.name }}</author> <author>{{ .Params.author }}</author>
<guid>{{ .Permalink }}</guid> <guid isPermaLink="true">{{ .Permalink }}</guid>
<description>{{ printf `<![CDATA[%s]]>` .Summary | safeHTML }}</description> <description>{{ printf `<![CDATA[%s]]>` .Params.description | safeHTML }}</description>
<content:encoded type="html">{{ printf `<![CDATA[%s]]>` .Content | safeHTML }}</content:encoded> {{ $content := .Content}}
{{- if .Params.Cover }}
{{- $content = (printf `%s%s` (partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "post-cover")) $content) }}
{{- end }}
<content:encoded type="html">{{ printf `<![CDATA[%s]]>` $content | safeHTML }}</content:encoded>
</item> </item>
{{- end }} {{- end }}
</channel> </channel>

Loading…
Cancel
Save