welpo / tabi

A modern Zola theme with search, multilingual support, optional JavaScript, a perfect Lighthouse score, and a focus on accessibility.
https://welpo.github.io/tabi/
MIT License
98 stars 32 forks source link

Hardcoded feed path on header #352

Open welpo opened 1 week ago

welpo commented 1 week ago

Bug Report

Expected Behavior

Disabled feeds don't get a feed link in header.

Current Behavior

Even disabling all feeds, the header generates a <link rel="alternate" type="application/atom+xml"… link hardcoded to atom.xml.

Step to Reproduce

Disable feeds with generate_feeds = false. See header in any page.

Problematic code

https://github.com/welpo/tabi/blob/f72f454ea714e4204ac1bcec64a55d9a1165cfbb/templates/partials/header.html#L18-L19

Proposed solution

Zola 0.19.x generates an array of feeds in config.feed_filenames. This looks good: https://github.com/getzola/zola/issues/2561#issuecomment-2203340024 (including the type on each link).

It would be nice to provide fallback for older Zola versions in a similar way as we do for the footer: https://github.com/welpo/tabi/blob/f72f454ea714e4204ac1bcec64a55d9a1165cfbb/templates/partials/footer.html#L16-L27 (though here we only grab the first item; we should add both/whatever's available on header).