XML: Prettify RSS and Atom feeds by taking care of whitespace
This commit is contained in:
parent
d4914ef2f9
commit
67c8917d99
|
@ -23,20 +23,20 @@
|
|||
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
||||
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
{{- with .OutputFormats.Get "RSS" }}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{ end }}
|
||||
{{ range where .Site.Pages "Kind" "page" }}
|
||||
{{ if or (eq .Section "posts") (eq .Section "post") }}
|
||||
{{- end }}
|
||||
{{- range where .Site.Pages "Kind" "page" }}
|
||||
{{- if or (eq .Section "posts") (eq .Section "post") }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{- .Content | html -}}</description>
|
||||
<description>{{ .Content | html }}</description>
|
||||
</item>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
|
@ -30,6 +30,6 @@
|
|||
<email>{{ $.Site.Author.email }}</email>
|
||||
</author>
|
||||
</entry>
|
||||
{{end}}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
</feed>
|
||||
|
|
Loading…
Reference in New Issue