zola: Zola Builds Broken RSS/atom feed
Environment
Zola 0.16.1 running in Arch-Based Linux Distribution
Configuration
generate_feed = true
feed_filename = “atom.xml”
Steps
Enable the above configurations in config.toml
Run zola build
or zola serve
Current Behavior
When I try to add the output feed atom.xml
in my rss reader (I am using Thunderbird), It gives an error saying It’s not a valid Feed.
Validating the feed with w3c feed validator, it shows following errors:
Missing entry element: author
</entry>
title should not be blank
<title></title>
Expected Behavior
The feed should have been validated without any error.
Detected Problem
It generates the feed (atom.xml
) with Empty title.
...
...
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<title></title>
...
...
Remark
Using feed_filename = "rss.xml"
in place generates rss.xml
with empty title and description.
...
...
<channel>
<title></title>
<link>http://127.0.0.1:1111</link>
<description></description>
<generator>Zola</generator>
<language>en</language>
...
...
Temporary/Manual Solution
Adding the title manually in atom.xml
solved the problem for me or adding title and description manually if you’re using rss.xml
.
...
...
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
<title>My Blogs</title>
...
...
Permanent Solution
Zola should detect the default title and description in following priority order or similar appropriate one and use it:
- /content/blog/_index.md
- /templates/blog.html
- config.toml
Reference Project
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 20 (5 by maintainers)
Links to this issue
Commits related to this issue
- Configure title & description * Adjustments found while investigating getzola/zola#2024 * Zola uses both values when generating atom.xml, despite being marked optional. * Have base.html also use the ... — committed to sangsatori/helix-editor-website by sangsatori 2 years ago
- Configure title & description (#22) * Adjustments found while investigating getzola/zola#2024 * Zola uses both values when generating atom.xml, despite being marked optional. * Have base.html also ... — committed to helix-editor/website by sangsatori 2 years ago
- Page and config authors (#2024) (#2092) The W3C feed validator fails to validate RSS 2.0 and Atom 1.0 feed elements that do not contain a valid author. This change adds an `authors: Vec<String>` to... — committed to getzola/zola by sethm a year ago
- Page and config authors (#2024) (#2092) The W3C feed validator fails to validate RSS 2.0 and Atom 1.0 feed elements that do not contain a valid author. This change adds an `authors: Vec<String>` to... — committed to getzola/zola by sethm a year ago
I think so. I’ve created https://github.com/getzola/zola/pull/2092.
It seems ok to me, just need to add some words about it in the docs.
Anyone disagree with the current approach for authors?
Yeah @Keats, It does and validates the W3C Feed Validation as well for both RSS and atom feeds.
It’s an interesting question. In Atom, author information is more structured than in RSS 2.0, and they are potentially contradictory.
<author>...</author>
element. The specification says that this should contain the email address of the author, and optionally a name, in the formatauthor@example.com
orauthor@example.com (Author Name)
.<author>...</author>
element that must contain at least<name>...</name>
, but may also contain<email>...</email>
and<uri>...</uri>
elementsPerhaps Zola authors should be structured in a similar way? For example, in YAML we could permit:
equivalent TOML:
One downside is that RSS 2.0 feeds would not validate unless the author contains an email address, and Atom 1.0 feeds would not validate unless the author contains a name. It’s a bit messy and complex.
I ran into this issue myself and worked around it with a custom
atom.xml
template, so I would love to give try to fix it. It would be my first contribution to the project, but I do have Rust experience.The title can potentially be fixed (eg use url of the site if we have nothing) but what do we do for the author?