File: list.rss.xml

package info (click to toggle)
hugo 0.155.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 43,600 kB
  • sloc: javascript: 31,879; ansic: 2,350; xml: 350; makefile: 196; sh: 110
file content (33 lines) | stat: -rw-r--r-- 1,618 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hugo News</title>
    <description>Recent news about Hugo, a static site generator written in Go, optimized for speed and designed for flexibility.</description>
    <link>{{ .Permalink }}</link>
    <generator>Hugo {{ hugo.Version }}</generator>
    <language>{{ or site.Language.LanguageCode site.Language.Lang }}</language>
    {{- with site.Copyright }}
      <copyright>{{ . }}</copyright>
    {{- end }}
    {{- with .OutputFormats.Get "rss" }}
      {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
    {{- end }}
    {{- $limit := cond (gt site.Config.Services.RSS.Limit 0) site.Config.Services.RSS.Limit 999 }}
    {{- $pages := "" }}
    {{- with site.GetPage "/news" }}
      {{- $pages = .Pages.ByPublishDate.Reverse | first $limit }}
    {{- else }}
      {{- errorf "The list.rss.xml layout was unable to find the 'news' page." }}
    {{- end }}
    <lastBuildDate>{{ (index $pages 0).PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
    {{- range $pages }}
      <item>
        <title>{{ .Title }}</title>
        <link>{{ or .Params.permalink .Permalink }}</link>
        <pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
        <guid>{{ or .Params.permalink .Permalink }}</guid>
        <description>{{ .Summary | transform.XMLEscape | safeHTML }}</description>
      </item>
    {{- end }}
  </channel>
</rss>