Section.generate_feed does not exist

I have generate_feeds = false in config.toml and generate_feeds = true in /section/ in the front matter. Zola correctly does not generate the atom feed for the whole site but only for section. But I cannot access the configuration option in the templates. While there exists {{ config.generate_feeds }}, there is no {{ section.generate_feeds }} so I cannot write a general template for base.html or section.html where I could generate a feed meta tag for sections that have it enabled as opposed to how it is available for feeds for the whole site:

{% if config.generate_feed %}
{% block feed %}
<link rel="alternate" type="application/atom+xml" title="RSS" 
      href="{{ get_url(path="atom.xml", trailing_slash=false) }}">
{% endblock feed %}
{% endif %}

the only workaround is the create separate template just for this specific section, but this is not very optimal for the case where there are different and many sections with different configurations.

Am I missing something?

This field is currently not passed when serialising a section to the templates. It’s pretty easy to add it though.

1 Like

Can you try this branch: Next version by Keats · Pull Request #2103 · getzola/zola · GitHub ?