At some point in the past I had configured an atom feed for my blog. In config/_default/config.yml I have:
outputs:
home:
- HTML
- RSS
- Atom
outputFormats:
RSS:
mediatype: "application/rss+xml"
baseName: "rss"
Atom:
mediatype: "application/atom+xml"
baseName: "atom"
mediaTypes:
application/rss+xml:
suffixes:
- xml
application/atom+xml:
suffixes:
- xml
This results in files rss.xml and atom.xml. The RSS feed seems fine, but the atom feed no longer includes any posts. In layouts/_default/list.atom.xml I have:
I’m confident that at some point this worked, but now the the {{ range first 15 .Data.Pages }} expression only produces entries for “Abouts” and “Archives”. What’s going on here?
@jmooring thanks for the pointer. I’m not getting good results with .RegularPages either. If I simplify the template to look like this:
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ .Site.Title }}</title>
{{ range first 15 .RegularPages }}
<entry>
<title>{{ .Title }}</title>
</entry>
{{ end }}
</feed>
…then I get no <entry>...</entry> sections. If I try using .Data.RegularPages, it just blows up (Building sites … ERROR 2020/07/24 13:23:57 render of "taxonomy" failed: "..l.ist.atom.xml:4:11": execute of template failed: template: _default/list.atom.xml:4:11: executing "_default/list.atom.xml" at <first 15 .Data.RegularPages>: error calling first: both limit and seq must be provided).
For the home page, it ranges through .Site.RegularPages .
For section pages, it ranges through .RegularPages .
For everything else it ranges through .Pages .
Whoops, I missed the bit about `.Site.RegularPages; that seems to be the correct value. What I wonder if whether or not the existing template ever worked, or if I just never checked it until recently. Anyway, thanks!