jakelazaroff / radish

A delightful React-based static site generator that outputs plain HTML & CSS.
https://radishjs.com
95 stars 1 forks source link

Support RSS #3

Open jakelazaroff opened 2 years ago

jakelazaroff commented 2 years ago

Right now, Radish does a couple things that make the HTML authoring experience nicer:

These are both convenient for normal pages, but unnecessary for RSS, which is accessed by visiting the file directly (/blog/feed.xml) and doesn't need any sort of "shell" around it.

A solution to the first might be allowing the paths function to return file names as well. If the last segment of a path has an extension, Radish would create a file with that name and extension, rather than creating a folder and placing an index.html inside it.

I'm not sure how to solve the second right now — maybe another export from pages (export const shell = false;) that instructs Radish not to generate the surrounding markup?

20kdc commented 2 weeks ago

It seems like there is some (?) logic around pathnames for this in bundle.ts:writePage, but not when paths are specified, and I'm not sure what the situation is with it all & what is/isn't a bug. I don't really want to break anything if this is relied upon somehow...

It also seems like shell became layout.

Unfortunately I'm not sure how to output the <?xml version="1.0" encoding="UTF-8"?> header, or I'd document this. There is also the (minor) risk of HTML quirks versus XML, like how some tags in HTML are unclosed.