hebra icon indicating copy to clipboard operation
hebra copied to clipboard

RSS feed template errors when there are no posts

Open cbirdsong opened this issue 4 years ago • 0 comments

Used this as the basis for an extremely simple documentation site, and noticed the template filter rssLastUpdatedDate does not handle an empty collections.posts gracefully. Sidestepping the error is pretty simple:

{% if collections.posts | length %}
  <updated>{{ collections.posts | rssLastUpdatedDate }}</updated>
{% endif %}

However, I'm new to Eleventy, and this may need to be accompanied by a lower-level way to simply not output the RSS feed at all if there are no posts to fill it with.

cbirdsong avatar Aug 19 '19 16:08 cbirdsong