getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
12.96k stars 919 forks source link

Zola 0.19 no longer builds/serves if I enable feeds. #2534

Closed Jieiku closed 1 week ago

Jieiku commented 1 week ago

Bug Report

feeds worked fine with 0.18

I had to edit generate_feed = true to generate_feeds = true

however after doing so I see the following errors:

Error: Failed to serve the site
Error: Failed to render page '/home/jieiku/.dev/abridge/content/pages/contact.md'
Error: Reason: Failed to render 'pages.html' (error happened in 'base.html').
Error: Reason: Test call 'containing' failed
Error: Reason: Tester `containing` was called on an undefined variable

If I set generate_feeds = false then the site builds fine.

I assume this is related to this: https://github.com/getzola/zola/pull/2477 but I cannot say for sure. I am not using a custom feed template, I have always just let it build the feed using the default template.

Environment

Zola version: 0.19.0

Expected Behavior

the site to build or serve, or maybe to give a more detailed error.

Current Behavior

env RUST_BACKTRACE=1 ~/zola serve
Building site...
Checking all internal links with anchors.
> Successfully checked 7 internal link(s) with anchors.
-> Creating 29 pages (4 orphan) and 13 sections
Error: Failed to serve the site
Error: Failed to render section '/home/jieiku/.dev/abridge/content/archive/_index.md'
Error: Reason: Failed to render 'archive.html' (error happened in 'base.html').
Error: Reason: Test call 'containing' failed
Error: Reason: Tester `containing` was called on an undefined variable

Step to reproduce

git clone https://github.com/Jieiku/abridge cd abridge

edit config.toml replacing occurrances of generate_feed = true with generate_feeds = true

zola serve zola build

Keats commented 1 week ago

You have a bunch of {% if config.feed_filename is containing('atom') %} but it's now config.feed_filenames and is an array.

Relevant lines from the Changelog:

Changed config options named generate_feed to generate_feeds (both in config.toml and in section front-matter)
Changed config option feed_filename: String to feed_filenames: Vec<String>
Jieiku commented 1 week ago

I missed that the feed_filename is now an array. Thank You!

For anyone else that finds this issue report it is a good idea to just search your entire site/theme for the word feed:

grep --color --include=\*.html -rnw "/home/jieiku/.dev/abridge/" -e ".*feed.*"