Skip to content
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

Atom/RSS feed error #493

Open
irosyadi opened this issue Oct 18, 2023 · 6 comments
Open

Atom/RSS feed error #493

irosyadi opened this issue Oct 18, 2023 · 6 comments

Comments

@irosyadi
Copy link

irosyadi commented Oct 18, 2023

There was a problem with the Atom/RSS feed at /feed.xml. The error message says error on line xx at column 17: Opening and ending tag mismatch: link line xx-1 and entry. The specific line xx with the error can vary from site to site.

I found similar errors in these feeds: https://notes.ole.dev/feed.xml and https://hermitage.utsob.me/feed.xml. But these feeds are fine: https://dg-docs.ole.dev/feed.xml and https://notes.johnmavrick.com/feed.xml.

@dayne
Copy link
Contributor

dayne commented Nov 2, 2023

Interesting. I can't help other than confirm I see this issue too. I haven't dug any deeper other than verifying my garden's feed at https://hive.mod0.org/feed.xml has same error. I've not used/looked at that before and so not a big deal for me yet but is a feature I would like working for some future integrations.

Uninformed thought/no research: I wonder if the difference between working/non-working feeds is triggered by a specific post title/comment that has special characters in it that need to be escaped before being tossed to the generator of the feed.

@irosyadi
Copy link
Author

irosyadi commented Nov 17, 2023

I looked more closely. In the working RSS, the 'feed.xml' file correctly closes the 'link' tag.

<link href="https://dg-docs.ole.dev/feed.xml" rel="self" />
<link href="https://dg-docs.ole.dev" />
<link href="https://dg-docs.ole.dev/troubleshooting/" />

But, in the faulty RSS, the 'link' tag isn't closed properly.

<link href="https://notes.ole.dev/feed.xml" rel="self" >
<link href="https://notes.ole.dev" >
<link href="https://notes.ole.dev/ressurser/snippets/vim-cheatsheet/" >

@dayne
Copy link
Contributor

dayne commented Nov 24, 2023

Interesting. Looping back to learn more about this by playing around and documenting my thought process in case it helps others debug this.

In the the feed.njk template it has four //// for the links like so: https://github.com/oleeskild/digitalgarden/blob/main/src/site/feed.njk#L10

<link href="{{ meta.siteBaseUrl }}{{ permalink }}" rel="self" ////>`

The reason behind using four //// in that tag escaping me. Looking at 11ty's RSS example they have the standard syntax I'd expect of a single / like so:

<link href="{{ metadata.url }}"/>

However, we don't have a feed.xml file we have a feed.njk file, and the .njk means this is a Nunjucks template file. In theory the way to get a trailing / for the tag should just be as simple as putting it directly there in the file and there isn't a need for ////.

I did a few quick tests directly on my site to see if removing the extra /// solved the feed issue. (Running with scissors in my own garden is fun).

When switching to a single / I ended up with none rendered in the final feed.xml. I tried doing // to see if that changed things and still nope. Even tried \/and ended up with just a \ which just caused XML syntax errors.

  • ////> becomes >
  • ///> becomes >
  • //> becomes >
  • /> becomes >
  • \/> becomes \> an XML syntax error
  • / > becomes / > another XML syntax error: XML Parsing Error: not well-formed
  • \\/> becomes '\>` another XML error
  • ></link> becomes > - hey, what is going on there? somebody is "helping" and I bet that somebody is the culprit for the confusion above.
  • /////> becomes /> - *HEY THAT IS WHAT WE WANT -- Is FIVE the magic? Not 1, 2, 3, 4 but 5?"

So yeah, apparently the fix in feed.njk is to for each link tag to have five ///// like so:

    <link href="{{ meta.siteBaseUrl }}{{ permalink }}" rel="self" /////>
    <link href="{{ meta.siteBaseUrl }}" /////>

@rubenrivera
Copy link

rubenrivera commented Jan 10, 2024

I just applied the fix suggested by @dayne. The /feed.xml from my digital garden is not throwing errors anymore. There were three lines on the feed.njk file where I added an extra /: 10, 11, and 26.

africanmoose added a commit to africanmoose/digitalgarden that referenced this issue Feb 19, 2024
wwha added a commit to wwha/dg-obsidian that referenced this issue Feb 24, 2024
wwha added a commit to wwha/dg-obsidian that referenced this issue Jun 16, 2024
wwha added a commit to wwha/dg-obsidian that referenced this issue Sep 1, 2024
@jediskygit
Copy link

Hi, it seems that the error is still present. example, this test site that I'm using https://functionalitytest.vercel.app/feed.xml

@jediskygit
Copy link

Hi, it seems that the error is still present. example, this test site that I'm using https://functionalitytest.vercel.app/feed.xml

Eventually, rss works fine by applying the previously mentioned fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants