Hello,
As you can see here: https://simplepie.org/demo/?feed=https%3A%2F%2Fwww.statsandr.com%2Findex.xml, the full content is displayed in the RSS feed.
However, I would like to also show the full content in this RSS feed: https://simplepie.org/demo/?feed=https%3A%2F%2Fwww.statsandr.com%2Ftags%2Fr%2Findex.xml. For the moment, only a summary is displayed.
Any idea how to fix this issue?
Thanks in advance.
Best,
Antoine
Here is the file I edited to display all content for the general RSS feed: https://github.com/AntoineSoetewey/statsandr/blob/master/layouts/rss.xml
This is a simplified version of the related part in my rss layout:
<description>
{{ "<![CDATA[" | safeHTML }}
{{ $content := .Content }}
{{ $content = replace $content "href=\"/" "href=\"https://example.com/" }}
{{ $content = replace $content "src=\"/" "src=\"https://example.com/" }}
{{ $content | safeHTML }}
{{ "]]>" | safeHTML }}
</description>
The two things I’ve had to do, besides replacing the summary with {{ .Content }}
was to add <![CDATA[...]]>
to escape the tags inside <description>
, and the other was to replace relative urls in my website with absolute ones. There may be an easier way, but that what I came up with.
There are more adjustments in my actual code because some of my pages have iframes (for videos) and JavaScript, and I needed to remove those elements in the feed.
Thanks !
I finally managed to find a solution by adding two folders: one for categories and one for tags and put the rss.xml file (with Content instead of Summary as you mentioned) inside those two folders. I also don’t know if there is a simple method, but it seems to work.
For those interested, you can have a look here: https://github.com/AntoineSoetewey/statsandr/tree/master/layouts.