diff options
Diffstat (limited to 'posts/full-posts-rss-readers.txt')
-rw-r--r-- | posts/full-posts-rss-readers.txt | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/posts/full-posts-rss-readers.txt b/posts/full-posts-rss-readers.txt new file mode 100644 index 0000000..cc42bf3 --- /dev/null +++ b/posts/full-posts-rss-readers.txt @@ -0,0 +1,111 @@ +Fri, 06 May 2022 +FULL POSTS ARE NOW RENDERED INSIDE RSS READERS + +Your subscribers can now read your full articles without leaving the +comfort of their RSS readers. + +I have finally succeeded after fighting with properly rendering full +post content directly _inside_ RSS readers. I struggled with this +implementation far longer than I'd like to admit. Although, that's to +be expected with my caveman knowledge of RSS feeds and my simple monkey +brain. + +But here we are! We made it. + + +INSPIRATION +----------- + +The thought of rendering all the content within users' RSS readers was +always something I wanted for the initial launch of Shinobi Website. It +was taking me a while to understand the layout issues caused by +articles being pure plain text, so I ended up giving up for version +"1.0". + +Then fellow web-minimalist Matthew Graybosch kindly reached out and +showed off his own beautifully crafted shinobi website[0]. Browsing +through his site and articles I quickly realized a few rendering woes +of my own: + +1. Having set the reading length to 72, I was hurting the reading +experience for mobile users +2. Matthew was doing a lot more cool things on his site (D&D style +tables, separating specific feeds into their own directories) + +Shortly after this exchange I was contacted by another plain-text web +enthusiast, Koray Er[1]. They were inspired to start building out +their own Shinobi Website. This is where the question was brought up +regarding full post rendering: + +> i want the entire content in my rss reader - not just one line. the +best i could do was put $(tail -n +4 $file) in the description. that +works, but without line breaks. is it possible to fix that in rss.sh? i +don't want to change the txt - it's so pure. + +This was the final straw. I _needed_ to get this working in _some_ +capacity. + + +CDATA TO THE RESCUE +------------------- + +I played around with converting plain text to HTML and pasting it +inside the XML at build time. This created more problems than it fixed. +But finally, after roughly 2 hours of going down multiple rabbit holes +of failure, I mashed together a few concepts from everyone's trusty +copy/paste site: stackoverflow. + +Take a look at the newly updated shell script here: + +> https://shinobi.website/script.sh + +The only change I have made is inside the `description` tag within the +individual `item` elements. Take a look if you're interested. + +Wait, what the heck that CDATA junk, you might be asking? + +> CDATA is defined as blocks of text that are not parsed by the parser, +but are otherwise recognized as markup. + +After that we use `sed` to swap out any newlines with HTML line break +elements. Nothing crazy there. + +NOTE: +As you may have noticed on the main page of this project, the `rss.sh` +code snippet has been replaced with a direct link to a new `script.sh`. +Those wishing to implement this new style of formatting will need to +make the shell changes manually. + + +CAVEATS +------- + +Please note that if you are planning to render your content this way +there are minor things to look out for. + +1. Pasting code examples is a big no-no. The content will be mangled +and the reader will try to render example snippets as HTML elements. +Your best bet is to link directly to example files elsewhere in your +directory. + +^ THIS IS NO LONGER TRUE. See details below.[2] + +2. This may not work for every single RSS Reader. I can't test every +application out there in the wild nor can I double check different +operating systems. All I know is this renders fine for me on macOS +using NetNewsWire. + + +FOOTNOTES +--------- +[0]: https://matthewgraybosch.com/ +[1]: https://korayer.de/ +[2]: This issue has been fixed thanks to Matthew Graybosch's excellent +patch. See patch notes here: +https://git.sr.ht/~tdarb/shinobi-script/log?from=7e2f8bd312d648ff1c8d3cf +dc747d2e5634100d7#log-7e2f8bd312d648ff1c8d3cfdc747d2e5634100d7 + + +Thanks for reading my humble blog (maybe directly in your RSS reader +this time too!), +-- Brad
\ No newline at end of file |