genmon / aboutfeeds

Web feeds/RSS "getting started" guide for new users.
https://aboutfeeds.com
206 stars 13 forks source link

Feature: Page to help site owners to promote their feed #8

Open genmon opened 4 years ago

genmon commented 4 years ago

Problem: Web feeds are hard to discover for users (whether the site has a feed and, if it does, where that feed is).

This page should include a list of ideas would help when attracting users who don't yet have a newsreader installed.

Candidate ideas...

genmon commented 4 years ago

On formatting RSS feeds:

j-f1 commented 4 years ago

Maybe instead of having an XSLT file site owners could link to AboutFeeds and provide the URL for the feed as a query param so it could be rendered nicely here?

genmon commented 4 years ago

As as experiment, I've styled the RSS feed on my own blog. Here's how it looks:

Screenshot 2020-08-28 at 13 41 09

Some quirks, in no particular order:

To deactivate the browser's auto-open functionality, these HTTP Response headers must be set:

Content-Type: application/xml; charset=utf-8  # not application/rss+xml
x-content-type-options: nosniff

Check out my feed here.

(Based on this blog post: How to style RSS feed (Just Lepture).]

ldodds commented 4 years ago

I really like the simple layout and presentation šŸ‘

Did you test to see if the XSLT file will be applied if its served from a remote domain using appropriate CORS headers? I think that might work? However you then have the downside of having to host and serve that file so you're trading off easy updates with centralisation, although maybe a good CDN could help.

genmon commented 4 years ago

Did you test to see if the XSLT file will be applied if its served from a remote domain using appropriate CORS headers?

From what I've read, there's no way of working around this. It requires a tweak to the security settings, or it's unreliable. A shame!

adactio commented 4 years ago

This is a great idea! I've added your XSLT file to my feeds, which you can get to from here:

https://adactio.com/feeds/

The only change I've madeā€”and I'd suggest this in generalā€”is removing the hardcoded img hosted on aboutfeeds.com; that would make that domain a potential single point of failure.

If you think the image is really needed, maybe a data-URL is the way to go?

genmon commented 4 years ago

If you think the image is really needed, maybe a data-URL is the way to go?

I think the logo is important: it builds familiarity with a common symbol, and it distinguishes the feed page from the main website (which might look quite similar).

What do you think of inline SVG?

The original SVG file is linked here.

adactio commented 4 years ago

Oh yeah, inline SVG would work!

philgyford commented 4 years ago

Here's a little wrinkle that I discovered after trying to get this working on my own site...

The officially correct Content Type for RSS feeds is application/rss+xml. This is the default that Django's syndication feed framework uses, which is what I was struggling with. However, using this Content Type seems to prevent the linked XSLT file from even being loaded, so no styling takes place.

When I changed it to application/xml then the XSLT file was loaded and the feed was styled nicely. Both @genmon's and @adactio's feeds use application/xml, which is why it's working.

This is using Chrome on macOS. Firefox only ever wants to download XML rss+xml files and Safari only ever wants to open them in News.app; no idea if this is standard or something annoying about my instances of these apps.

genmon commented 4 years ago

@philgyford yes, this is tricky. Have a look at the required HTTP headers further up this thread. It looks like x-content-type-options: nosniff is needed. I don't know whether it's possible to embed this directive in the RSS feed itself. It's a hurdle either way.

Feels like it'll be good to get this XSLT to a point where the copy etc all makes sense, and then offer a hosted solution, as described in #22.

genmon commented 4 years ago

@adactio ok, check out my blog feed now! It uses inline SVG. XSLT is here: http://interconnected.org/home/static/styles/pretty-feed-v2.xsl

I've also changed "Recent Posts" -> "Recent Items" because I would like this XSLT to be generic to wherever there is a feed, and so it's better to err on the side of terminology expressed in the underlying protocol.

adactio commented 4 years ago

The inline SVG is working a treat! I've rolled it out on my site now too.

The mime-type issue is a real head-scratcher though. :-(

Treora commented 4 years ago

The mime-type issue is a real head-scratcher though. :-(

Indeed. I was happy to learn from the above discussion that browsers actually support XSLT, so an XML file can be made human-readable in browsers by adding a single line to it, and Iā€™d be eager to use this myself. But if obtaining this behaviour requires setting the Content-Type header to application/xml instead of application/rss+xml, might this result in other software (e.g. browser extensions, web crawlers) failing to detect it as being a feed? Or are there already so many feeds published with the ā€˜wrongā€™ mimetype that every such software already performs detection by sniffing the content?

Either way, it seems like a bad practice to misrepresent the content type. I suppose the real solution would be for browsers to interpret rss+xml (or anything+xml) as XML. I found an open issue about this on bugzilla, and one on the Chromium bug tracker. Both are classified as bugs, but with low priority.

davidbgk commented 3 years ago

Neat idea! I tried to implement my own version here: https://larlet.fr/david/log/ (with my own CSS, trying to keep consistency with the probable entry page).

A screenshot for the posterity:

Capture dā€™eĢcran, le 2021-06-02 aĢ€ 13 29 37

One thing I was frustrated with though: Firefox does not support disable-output-escaping="yes" which means that the content of the encoded entries displays the HTML without rendering it. You can notice the difference when you open the details/summary of an entry, in case of Firefox you will see the HTML vs. ChromeĀ·ium/Webkit displaying the rendered content.

I guess it would be possible to render the feed itself using another unescaped format (like CDATA) but I need to think about it. If you already bumped into that issue and solve it, do not hesitate to share your fix :)