<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet href="/rss.xsl" type="text/xsl"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><title>Xsl on Hyteck</title><link href="https://hyteck.de/tags/xsl/"/><generator>Hugo -- gohugo.io</generator><language>en-us</language><id>https://hyteck.de/tags/xsl/</id><updated>2024-04-16T12:10:10+02:00</updated><link href="https://hyteck.de/tags/xsl/index.xml" rel="self" type="application/rss+xml"/><entry><title>Styling an Django RSS Feed</title><link href="https://hyteck.de/post/django-rss/" type="application/octet-stream"/><updated>2024-04-16T12:10:10+02:00</updated><id>https://hyteck.de/post/django-rss/</id><author><name>Julian-Samuel Gebühr</name></author><content type="html"> &lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>RSS is amazing! While not everyone thinks that, most people that &lt;em>understand&lt;/em> RSS, like it. This presents a problem, as most people don&amp;rsquo;t have chance to learn about it. Unless there is a person in the community that doesn&amp;rsquo;t shut up about how great RSS is (maybe that person is you), they might not even know what it is, let alone use it.&lt;/p>
&lt;p>One big reason for this is, that when you click an link to an RSS feed you download a strange file that most people don&amp;rsquo;t know how to deal with. Maybe your browser is nice and renders some XML which is also not meant for human consumption. Wouldn&amp;rsquo;t it be better if people clicked on the RSS link and were greeted by a text explaining RSS and how to use it? And if the site would still be a valid RSS feed?&lt;/p>
&lt;p>Luckily you don&amp;rsquo;t have to imagine that - it&amp;rsquo;s possible! You can even try it on this blog by clicking the RSS link in the menu (&lt;a href="https://hyteck.de/index.xml">direct link&lt;/a>).&lt;/p>
&lt;p>Doing this has not been my idea. Darek Kay described this in the blog post &lt;a href="https://darekkay.com/blog/rss-styling/">Style your RSS feed&lt;/a> and I just copied most of their work! This was fairly easy for this Hugo blog and is &lt;a href="https://github.com/moan0s/hugo-nederburg-theme">available in my fork of the hugo-nederburg-theme&lt;/a>. However, in a Django project it get&amp;rsquo;s a bit more complicated. Let me explain.&lt;/p>
&lt;h2 id="the-problem">The Problem&lt;/h2>
&lt;p>Django has the great &lt;a href="https://docs.djangoproject.com/en/5.0/ref/contrib/syndication/">Syndication feed framework&lt;/a>, a high level framework to create RSS and Atom Feeds. This is great as we only need a few lines of code to create a feed. Here is an example from &lt;a href="https://notfellchen.org">notfellchen.org&lt;/a> that list animals that are in search for a new home. People should be able to follow the RSS feed to see new adoption notices. So lets do it&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># in src/fellchennasen/feeds.py&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> django.contrib.syndication.views &lt;span style="color:#f92672">import&lt;/span> Feed
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> .models &lt;span style="color:#f92672">import&lt;/span> AdoptionNotice
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">LatestAdoptionNoticesFeed&lt;/span>(Feed):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> title &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Notfellchen&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> link &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;/rss/&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> description &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Updates zu neuen Vermittlungen.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">items&lt;/span>(self):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> AdoptionNotice&lt;span style="color:#f92672">.&lt;/span>objects&lt;span style="color:#f92672">.&lt;/span>order_by(&lt;span style="color:#e6db74">&amp;#34;-created_at&amp;#34;&lt;/span>)[:&lt;span style="color:#ae81ff">5&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">item_title&lt;/span>(self, item):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> item&lt;span style="color:#f92672">.&lt;/span>name
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">item_description&lt;/span>(self, item):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> item&lt;span style="color:#f92672">.&lt;/span>description
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># in src/fellchennasen/urls.py&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>urlpatterns &lt;span style="color:#f92672">=&lt;/span> [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> path(&lt;span style="color:#e6db74">&amp;#34;&amp;#34;&lt;/span>, views&lt;span style="color:#f92672">.&lt;/span>index, name&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;index&amp;#34;&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> path(&lt;span style="color:#e6db74">&amp;#34;rss/&amp;#34;&lt;/span>, LatestAdoptionNoticesFeed(), name&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;rss&amp;#34;&lt;/span>), &lt;span style="color:#75715e"># &amp;lt;--- Added&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">...&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Wait that&amp;rsquo;s it? Yeah! We have a working RSS feed. And it was very convenient, Django allows us to create by just pointing it to the right model and fields we want to display.&lt;/p>
&lt;p>But here is the problem: How do we style this? We can&amp;rsquo;t just add a link to a stylesheet here.&lt;/p>
&lt;h2 id="the-solution">The solution&lt;/h2>
&lt;p>First we need to add our styling files. I&amp;rsquo;ll not go into detail how they work her, just refer &lt;a href="https://darekkay.com/blog/rss-styling/">Darek&amp;rsquo;s blog post&lt;/a> for that. In Django we add them to our static files&lt;/p>
&lt;ul>
&lt;li>&lt;code>static/rss.xsl&lt;/code> will be adjusted based on &lt;a href="rss.xsl">this file&lt;/a>. It is responsible for creating a html rendering of your XML file&lt;/li>
&lt;li>for &lt;code>static/css/rss-styles&lt;/code> you can drop in &lt;a href="rss-styles.css">this file&lt;/a>, which is a basic CSS file you can edit to your liking.&lt;/li>
&lt;/ul>
&lt;p>After that comes the hard part. How do tweak this wonderfully simple Feed class to include a link to our style sheet? I first thought &amp;ldquo;that must be easy, just follow the docs on &lt;a href="https://docs.djangoproject.com/en/5.0/ref/contrib/syndication/#custom-feed-generators">custom feed generators&lt;/a> and add a root element. Something like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">FormattedFeed&lt;/span>(Rss201rev2Feed):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">add_root_elements&lt;/span>(self, handler):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> super()&lt;span style="color:#f92672">.&lt;/span>add_root_elements(handler)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e"># We want &amp;lt;?xml-stylesheet href=&amp;#34;/static/rss.xsl&amp;#34; type=&amp;#34;text/xsl&amp;#34;?&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> handler&lt;span style="color:#f92672">.&lt;/span>addQuickElement(&lt;span style="color:#e6db74">&amp;#34;?xml-stylesheet&amp;#34;&lt;/span>, &lt;span style="color:#e6db74">f&lt;/span>&lt;span style="color:#e6db74">&amp;#39;href=&amp;#34;&lt;/span>&lt;span style="color:#e6db74">{&lt;/span>static(&lt;span style="color:#e6db74">&amp;#34;rss.xsl&amp;#34;&lt;/span>)&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">&amp;#34;&amp;#39;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">LatestAdoptionNoticesFeed&lt;/span>(Feed):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> feed_type &lt;span style="color:#f92672">=&lt;/span> FormattedFeed
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> title &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Notfellchen&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">...&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Looks good. Let&amp;rsquo;s try. Oh no what is this?&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-xml" data-lang="xml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#960050;background-color:#1e0010">&amp;lt;&lt;/span>?xml-stylesheet href=&amp;#34;/static/rss.xsl&amp;#34;/&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Yes, we can&amp;rsquo;t correctly close this tag. There is (to my knowledge) no easy way to do this. So let&amp;rsquo;s take the hard road an implement a custom write function. In the following the write function will be copied from &lt;code>django.utils.feedgenerator.RssFeed&lt;/code>. We make two important changes to the class:&lt;/p>
&lt;ol>
&lt;li>Changing the content type from &lt;code>content_type = &amp;quot;application/rss+xml; charset=utf-8&amp;quot;&lt;/code> to &lt;code>content_type = &amp;quot;text/rss+xml; charset=utf-8&lt;/code>. This will make a browser display the content rather than opening it in a app.&lt;/li>
&lt;li>Adding our xml-stylsheet information. This is done in the &lt;code>write()&lt;/code> function with this line&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>handler&lt;span style="color:#f92672">.&lt;/span>_write(&lt;span style="color:#e6db74">f&lt;/span>&lt;span style="color:#e6db74">&amp;#39;&amp;lt;?xml-stylesheet href=&amp;#34;&lt;/span>&lt;span style="color:#e6db74">{&lt;/span>static(&lt;span style="color:#e6db74">&amp;#34;rss.xsl&amp;#34;&lt;/span>)&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">&amp;#34; type=&amp;#34;text/xsl&amp;#34;?&amp;gt;&amp;#39;&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Putting it all together we still have a relativly simple solution with only the necessary adjustments. Here is the full &lt;code>feeds.py&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> django.contrib.syndication.views &lt;span style="color:#f92672">import&lt;/span> Feed
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> django.utils.feedgenerator &lt;span style="color:#f92672">import&lt;/span> Rss201rev2Feed
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> django.templatetags.static &lt;span style="color:#f92672">import&lt;/span> static
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> django.utils.xmlutils &lt;span style="color:#f92672">import&lt;/span> SimplerXMLGenerator
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> .models &lt;span style="color:#f92672">import&lt;/span> AdoptionNotice
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">FormattedFeed&lt;/span>(Rss201rev2Feed):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> content_type &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;text/xml; charset=utf-8&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">write&lt;/span>(self, outfile, encoding):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> handler &lt;span style="color:#f92672">=&lt;/span> SimplerXMLGenerator(outfile, encoding, short_empty_elements&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#66d9ef">True&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> handler&lt;span style="color:#f92672">.&lt;/span>startDocument()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> handler&lt;span style="color:#f92672">.&lt;/span>_write(&lt;span style="color:#e6db74">f&lt;/span>&lt;span style="color:#e6db74">&amp;#39;&amp;lt;?xml-stylesheet href=&amp;#34;&lt;/span>&lt;span style="color:#e6db74">{&lt;/span>static(&lt;span style="color:#e6db74">&amp;#34;rss.xsl&amp;#34;&lt;/span>)&lt;span style="color:#e6db74">}&lt;/span>&lt;span style="color:#e6db74">&amp;#34; type=&amp;#34;text/xsl&amp;#34;?&amp;gt;&amp;#39;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> handler&lt;span style="color:#f92672">.&lt;/span>startElement(&lt;span style="color:#e6db74">&amp;#34;rss&amp;#34;&lt;/span>, self&lt;span style="color:#f92672">.&lt;/span>rss_attributes())
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> handler&lt;span style="color:#f92672">.&lt;/span>startElement(&lt;span style="color:#e6db74">&amp;#34;channel&amp;#34;&lt;/span>, self&lt;span style="color:#f92672">.&lt;/span>root_attributes())
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> self&lt;span style="color:#f92672">.&lt;/span>add_root_elements(handler)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> self&lt;span style="color:#f92672">.&lt;/span>write_items(handler)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> self&lt;span style="color:#f92672">.&lt;/span>endChannelElement(handler)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> handler&lt;span style="color:#f92672">.&lt;/span>endElement(&lt;span style="color:#e6db74">&amp;#34;rss&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">LatestAdoptionNoticesFeed&lt;/span>(Feed):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> feed_type &lt;span style="color:#f92672">=&lt;/span> FormattedFeed
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> title &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Notfellchen&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> link &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;/rss/&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> description &lt;span style="color:#f92672">=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;Updates zu neuen Vermittlungen.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">items&lt;/span>(self):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> AdoptionNotice&lt;span style="color:#f92672">.&lt;/span>objects&lt;span style="color:#f92672">.&lt;/span>order_by(&lt;span style="color:#e6db74">&amp;#34;-created_at&amp;#34;&lt;/span>)[:&lt;span style="color:#ae81ff">5&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">item_title&lt;/span>(self, item):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> item&lt;span style="color:#f92672">.&lt;/span>name
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">def&lt;/span> &lt;span style="color:#a6e22e">item_description&lt;/span>(self, item):
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> item&lt;span style="color:#f92672">.&lt;/span>description
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>And finally we have what we want! A RSS feed displayed in the browser, with beginner-friendly explanation and still completely spec-compliant.&lt;/p>
&lt;p>&lt;img src="screenshot1.jpeg" alt="Screenshot of a website">&lt;/p>
&lt;h2 id="outlook">Outlook&lt;/h2>
&lt;p>Now you may recognize I&amp;rsquo;m not a frontend person. The style could be prettier and provide a better overview. But I&amp;rsquo;d argue the improvement is immense and might help a user to get started with RSS.&lt;/p>
&lt;p>There are still a couple things to improve:&lt;/p>
&lt;ul>
&lt;li>Translation: The current text is only displayed in english&lt;/li>
&lt;li>The &lt;code>rss.xsl&lt;/code> file has a hard-coded link to the css stylesheet in it&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-html" data-lang="html">&lt;span style="display:flex;">&lt;span>&amp;lt;&lt;span style="color:#f92672">link&lt;/span> &lt;span style="color:#a6e22e">rel&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;stylesheet&amp;#34;&lt;/span> &lt;span style="color:#a6e22e">type&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;text/css&amp;#34;&lt;/span> &lt;span style="color:#a6e22e">href&lt;/span>&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#34;/static/fellchensammlung/css/rss-styles.css&amp;#34;&lt;/span>/&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Both can be solved by templating the &lt;code>rss.xsl&lt;/code> instead of serving it as static file.&lt;/p>
&lt;p>So have fun playing around! If you have created or found a nice-looking RSS feed let me know. Let&amp;rsquo;s keep RSS alive and thriving!&lt;/p>
&lt;script type="text/javascript" src="https://latest.cactus.chat/cactus.js">&lt;/script>
&lt;link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css">
&lt;div id="comment-section">&lt;/div>
&lt;script>
initComments({
node: document.getElementById("comment-section"),
defaultHomeserverUrl: "https://matrix.cactus.chat:8448",
serverName: "cactus.chat",
siteName: "hyteck",
commentSectionId: "django-rss"
})
&lt;/script></content></entry></feed>