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
97 stars 32 forks source link

footer template doesn't handle changed feed config of new 0.19.0 version of Zola #335

Closed grifferz closed 1 week ago

grifferz commented 1 week ago

Bug Report

The new 0.19 version of Zola breaks addition of feed icon in templates/partials/footer.html.

Environment

Zola version: 0.19.0 tabi version or commit: 2.10

Expected Behavior

A feed icon is present in the footer.

Current Behavior

Due to testing for variables that no longer exist, no feed icon is generated in the footer. I was also actually getting errors from zola serve related to this, but now I don't seem to be able to reproduce that.

Also it seems there can be multiple feeds now (atom and rss at the same time) so it's unclear what changes would need to be made to this template.

Step to Reproduce

After upgrading Zola to 0.19.0 it forces me to change generate_feed to generate_feeds and feed_filename = "atom.xml" to feed_filenames = ["atom.xml"] (I understand there could also be an rss.xml in there, to generate both).

Now serving or building the site results in there being no feed icon because of this test and this test in templates/partials/footer.html which are now testing unset variables.

I can make it work again by doing this:

{%- if (config.generate_feeds or config.generate_feed) and config.extra.feed_icon -%}
<li>
    <a class="nav-links no-hover-padding social" rel="{{ rel_attributes }}" {{ blank_target }} href={{ get_url(path=config.feed_filenames[0], lang=lang, trailing_slash=false) | safe }}>

but I don't know what should be done about the possibility of there being multiple feed_filenames now.

The 0.19.0 release of Zola is forcing me to make those config key renames so even if I am happy with a single feed I can't avoid the change. Perhaps that is a bug in Zola also.

welpo commented 1 week ago

Thanks for the report.

I am working on making tabi 0.19.0 ready. Development is happening on branch 0.19.x.

My goal is to make tabi 0.19.0 compatible while not breaking anything for 0.18.0 users. I've just pushed a commit that should achieve this for the feed icon.

For now, I'm just linking the first feed in feed_filenames. I think a better solution would be to:

If you could give that branch a try and let me know of any issues, I'd really appreciate it.

grifferz commented 1 week ago

If you could give that branch a try and let me know of any issues, I'd really appreciate it.

Thanks, I am now doing that and footer work as expected with config.toml:

generate_feeds = true
feed_filenames = ["atom.xml"]
welpo commented 1 week ago

Thanks for testing! I've merged the branch.