Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Speaking of advocating RSS, I was trying out Nikola [0] for static site generation and found that they have a really nice-looking RSS end-point [1] that is viewable both from the browser and an RSS reader. Looking into the XML, it turns out it's called xml-stylesheet:

    <?xml-stylesheet type="text/xsl" href="assets/xml/rss.xsl" media="all"?>
And I would argue that this is an excellent way to introduce new readers to RSS: instead of the browser popping up a download prompt, you can make your RSS feeds themselves a dedicated page for advocating RSS, in case an interested reader is browsing through the links on your site.

[0] https://getnikola.com/

[1] https://getnikola.com/rss.xml (Open it in your browser!)

[2] https://github.com/getnikola/nikola/blob/master/nikola/data/...



I've once blogged about this technique, in case someone wants to learn more about it: https://darekkay.com/blog/rss-styling/


thanks, really appreciate that your post was concise and included examples/followups. only needed 10 minutes to style my own rss feed


Man what a blast from the past. There was a moment in time where xml and xlst was considered the bright future of webapps


I remember writing a blog with xml + xslt and thought it was very cool.

Retrospectively, writing code in XML, eewwww, but back then I liked writing XHTML by hand


+1 on XHTML by hand, I'd always have the XHTML 1.0 badge up to brag about it too: https://en.m.wikipedia.org/wiki/File:Valid_XHTML_1.0.svg


I mean it was fine but debugging it was a pain.


My suggestion for best practice would be to have a feed endpoint that is as minimal and clean as possible, and provide a separate endpoint (can be the same base url but with a parameter) for human consumption. This ensures maximal compatibility and ease of consumption for both machine and human.


I disagree, you can have an XML feed that does both

For example: https://andrewstiefel.com/feed.xml


Yes, and if everything is properly configured that is great. Where is falls apart is when your site host/admin slaps Cloudflare protection on the domain and forgets to properly exclude the RSS pages, then programs can't fetch the feed without resorting to anti-bot evasion tech scraping, and are left with rendered HTML instead of the actual feed and have to deal with that.

Niche? It happens far more than you think.


This is brilliant. Thanks for sharing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: