11ty / 11ty-website

Documentation site for the Eleventy static site generator.
https://www.11ty.dev/
MIT License
473 stars 680 forks source link

Reset layout data in rss.md example #1626

Open crystalsolenoid opened 1 year ago

crystalsolenoid commented 1 year ago

I tried copy-pasting this example, and when I entered my output feed.xml file into the validator, I got an error:

It looks like this is a web page, not a feed. I looked for a feed associated with this page, but couldn't find one. Please enter the address of your feed to validate.

I realized that what was happening was that my data cascade was applying a layout that wrapped the XML tag in my default HTML layout.

I've changed the example .njk file to add a line in the front matter that resets any layout data from the cascade.

Another option would be to add a warning or clarification to the text, but I thought this seemed like a straightforward way to prevent future readers from making my mistake.