pawroman / zola-theme-terminimal

A simple, minimal retro theme for Zola
https://pawroman.github.io/zola-theme-terminimal/
Other
368 stars 85 forks source link

RSS Generation Breaks in Zola 0.19.0 due to multiple feeds change #64

Closed phocks closed 1 month ago

phocks commented 2 months ago

This seems to be breaking, because the value is expected to be a list/array in Zola 0.19.0 https://github.com/pawroman/zola-theme-terminimal/blob/c62018781192a6b3bc37860b10d6550eac77994c/templates/index.html#L16-L23

https://github.com/getzola/zola/commit/c054ed1b10163085f82805ba630d54ffbc3b8d03

I've managed to get it working with help from here: https://zola.discourse.group/t/0-19-broke-builds/2219

{#- Rss / Atom Feed #}

    {%- if config.generate_feeds %}
        {%- for feed in config.feed_filenames %}

            {%- if feed is containing('atom') %}
                <link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
            {%- endif %}

            {%- if feed is containing('rss') %}
                <link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
            {%- endif %}

        {%- endfor %}
    {%- endif %}
goingforbrooke commented 1 month ago

Nice find! I'll see about a PR...

goingforbrooke commented 1 month ago

Thanks for submitting an issue @phocks! 🏆

phocks commented 1 month ago

Thanks for the quick fix!

AntoniosBarotsis commented 1 month ago

@goingforbrooke Why were so many changes needed for this by the way, shouldn't this just be a variable name change? generate_feed -> generate_feeds.

phocks commented 1 month ago

@goingforbrooke Why were so many changes needed for this by the way, shouldn't this just be a variable name change? generate_feed -> generate_feeds.

I think it's because instead of a single feed string, it's an array/list of feeds now, so we need to loop over them.

AntoniosBarotsis commented 1 month ago

Ah I see. I didn't have time to take a closer look, thanks!

pawroman commented 1 month ago

Thanks for reporting. The fix looks good, we just need to resolve the fixing PR introducing some unrelated changes.

pawroman commented 1 month ago

This is now fixed.

Thanks to @goingforbrooke for the initial fix, and to @heitorPB for providing a clean fix.