Open apiraino opened 4 days ago
get_url
only accepts strings. config.feed_filenames
is an array
Then if I read the git history correctly, this breaking change probably comes from #2477 ? If yes, why do I not get this error in zola 0.19?
I feel that this breaking change (config parameter feed_filenames
) was not prominent enough. By looking at the list on linked issues and patches, this will break themes/CI, no?
The solution is to use a for loop:
<!DOCTYPE html>
<html lang="en">
<head>
{% for feed_filename in config.feed_filenames %}
<link href="{{ get_url(path=feed_filename) | safe }}"/>
{% endfor %}
</head>
<body></body>
</html>
Although in this specific case I would just write out each of the feeds manually because otherwise you have to handle type
and title
parameters in the loop which could get complicated (that is if you provide those, you really should for linking feeds), i.e.
<link rel="alternate" type="application/atom+xml" title="Example Blog - Atom Feed" href="{{ get_url(path="/atom.xml", trailing_slash=false) }}"/>
<link rel="alternate" type="application/rss+xml" title="Example Blog - RSS Feed" href="{{ get_url(path="/rss.xml", trailing_slash=false) }}"/>
Bug Report
Zola 0.19.1 broke the CI building my website.
Environment
Zola version: 0.19.1, Debian/trixie (current "testing" release) on Linux x86_64
Expected Behavior
get_url
is supposed to keep on accepting variables, correct? I assume this is a regression because it is nowhere mentioned in the changelog (unless I am missing something).Until Zola 0.19.0 it used to work.
Current Behavior
I use the after-dark theme where
get_url
is invoked with a config variable (see relevant code).Since Zola 0.19.1
get_url
only accepts strings (as the error says). If I change the template to using a string, the error disappears.Step to reproduce
Rendering this template will emit an error: