I’ve been using Eleventy to generate different files, from iCal to RSS. I talk about permalinks in another issue, but I’d like to address XML here. It seems like the parser behind WebC is HTML-only by design, which is not a problem for the main use case. But still :)
You can checkout the sample barebone project or use these steps to reproduce.
Steps to reproduce
1. Set up a sample project:
mkdir webc-xml
cd webc-xml
npm init -y
npm i --save-dev @11ty/eleventy@v2.0.0-canary.31 @11ty/eleventy-plugin-webc
2. Create eleventy.config.js with the following content:
I’ve been using Eleventy to generate different files, from iCal to RSS. I talk about permalinks in another issue, but I’d like to address XML here. It seems like the parser behind WebC is HTML-only by design, which is not a problem for the main use case. But still :)
You can checkout the sample barebone project or use these steps to reproduce.
Steps to reproduce
1. Set up a sample project:
2. Create
eleventy.config.js
with the following content:3. Create
svg.webc
with the following content4. Create
xml.webc
with the following content5. Run
npx @11ty/eleventy
Expected behavior
More or less intact, or functionally similar output in both cases:
_site/svg/index.html
_site/xml/index.html
I know, these files are HTML, but I was hoping to generate XML documents with WebC, too.
Actual behavior
In XML case:
In SVG case:
<style>
in SVG case