-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zola Builds Broken RSS/atom feed #2024
Comments
The title can potentially be fixed (eg use url of the site if we have nothing) but what do we do for the author? |
@Keats Thanks for the quick reply! After a little research I found out that you'll need to place the following inside each
Currently produced output:
Required Output
ConclusionPossible ways I could think of are below:
There could be better ways btw |
Or, simply use
|
The issue is that we don't force the user to put any of that data. I guess we could default to something like "unknown" and let people do their thing with a template if they want to. |
That's okay. But yeah, at least there should be some default value to it and there should be an option for user to provide a custom one as well, and the default one would be overwritten if used custom. |
Seems a sensible fallback to me. It's preferable to serving a non-working feed. |
* 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 same metadata.
It should work even without the title in most readers I think? That's a good first issue if someone wants to contribute |
* 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 same metadata.
@whoisYoges / @sangsatori just to be clear, does adding the author field makes Thunderbird happy with both RSS/atom feed? For title/description we could error if someone asks to generate a feed but doesn't fill both. |
Issue already existing #1223 |
Yeah @Keats, It does and validates the W3C Feed Validation as well for both RSS and atom feeds. |
Anyone interested in implementing #2024 (comment) ? Or if anyone has objections on that. |
I ran into this issue myself and worked around it with a custom |
Do we really want a |
I would go with a I think in most cases, there will be more author information in the extra section of I could be wrong though so let's think this through |
It's an interesting question. In Atom, author information is more structured than in RSS 2.0, and they are potentially contradictory.
Perhaps Zola authors should be structured in a similar way? For example, in YAML we could permit: authors:
- name: Author One
email: [email protected]
- name: Author Two
email: [email protected]
uri: https://example.com/user2/
- name: Author Three equivalent TOML: [[authors]]
name = "Author One"
email = "[email protected]"
[[authors]]
name = "Author Two"
email = "[email protected]"
uri = "https://example.com/user2"
[[authors]]
name = "Author Three" 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 would rather have something like that in config.toml (but with no way of enforcing it/up to the user): [extra]
[extra.authors]
[extra.authors.vincent]
name = "Vincent"
email = "..."
avatar = "vincent.jpg" The table is going to be more flexible. Either way, I don't want to impose anything there As for the pages themselves, let's go for a basic Vec where people can put whatever they want. We will use that value for the Atom feed and just put a note for the RSS feed that people will need to implement their own template to provide the email. |
OK, that makes sense to me. I have a potential solution ready to go in https://github.com/sethm/zola/commit/17c74de2ec8489f5b7f08abe0b2254ccca35a821, it uses no special structuring at all. I'll open a pull request if you think it's ready for one. |
It seems ok to me, just need to add some words about it in the docs. Anyone disagree with the current approach for authors? |
Looks good to me. Is this ready to progress to PR? |
I think so. I've created #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 pages, as well as an `author: Option<String>` to Config that will act as a default to use in RSS and Atom templates if no page-level authors are specified.
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 pages, as well as an `author: Option<String>` to Config that will act as a default to use in RSS and Atom templates if no page-level authors are specified.
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
orzola 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:
Expected Behavior
The feed should have been validated without any error.
Detected Problem
It generates the feed (
atom.xml
) with Empty title.Remark
Using
feed_filename = "rss.xml"
in place generatesrss.xml
with empty title and description.Temporary/Manual Solution
Adding the title manually in
atom.xml
solved the problem for me or adding title and description manually if you're usingrss.xml
.Permanent Solution
Zola should detect the default title and description in following priority order or similar appropriate one and use it:
Reference Project
https://github.com/whoisYoges/website
The text was updated successfully, but these errors were encountered: