very_small_image

When you have your website up and running and probably already started a little blog about data science related topics, you may want to share it with an even broader community. Here, R-bloggers and Python-bloggers are a great venue!

Both websites publish a collection of R and Python-related RSS feeds (amongst other, Methods Bites and the cynkra blog are also part of it!). To stay up to date, you can sign up on their newsletters (R-bloggers, Python-bloggers) or follow them on Twitter (R-bloggers, Python-bloggers) and Facebook (R-bloggers, Python-bloggers). In short, these feeds have an incredibly rich collection of R and Python-related knowledge you can also easily contribute to!

But how? Both websites offer a nice description of what to do to integrate your own RSS feed, but I was looking for a more specific solution how to integrate my Hugo-(Academic)-based blog.

When googling, I found various solutions (see for instance here or here). I followed Leslie Myint’s approach that she found and added the following lines to my config.toml.1

[outputs]
  home = [ "HTML", "RSS", "JSON", "WebAppManifest" ]
  section = [ "HTML", "RSS" ]
  taxonomy = [ "HTML", "RSS" ]
  taxonomyTerm = [ "HTML", "RSS" ]

For the Hugo Academic theme, there was not much more I needed to change (anymore).2 When switching to Hugo Portio, I had to add an rss.xlm file and tweak it a bit. But that was straightforward:

  1. Copy and paste the content of this file (it’s Hugo’s default RSS settings)
  2. Store it under layouts/_default/rss.xml (if there is no file, you need to create this one).
  3. Exchange one line. Instead of <description>{{ .Summary | html }}</description>, we want <description>{{ .Content | html }}</description> (it’s at the very bottom of the file). This way, you RSS feed doesn’t show an excerpt but the full text.

And that’s all you need 🥳

I categorize all blog posts (as I also have non-R/Python-related posts and want to keep R and Python-bloggers clean and tidy). It’s also in their policies where both feeds request to feed in only “meaty” posts and to avoid submitting short snippets. To access all R and Python-related posts, I use the categories R-post and Python-post. I sometimes make short (data science) posts that link to new Methods Bites posts, for instance, or also have a blog post with helpful code snippets, which I do not want to include in the feeds.

I call the following URL to access these posts: https://cosimameyer.rbind.io/category/r-post/index.xml (or https://cosimameyer.rbind.io/category/python-post/index.xml for Python posts). If you want to check how your RSS feed with R posts looks like, enter it here. The image below shows a screenshot of my results when entering my RSS feed for the category “R-post,” including a preview of one post.

small_image

And that’s it! If this page looks good and your full blog post is displayed, you’re almost good to go. Check if your feed coheres to the requirements and add the required info to the form – now it’s just waiting (a bit) until it’s checked and accepted 😊

smaller_image


  1. For home, the original first line only included the following elements: home = ["HTML", "CSS", "RSS"] but since my default setting also contained JSON and WebAppManifest, I left it as it was and just added the additional lines for taxonomy and taxonomyTerm. As a short disclaimer: I am not entirely sure whether I needed to add these two new lines to [outputs]. But since including them worked without any problem, I left them in. ↩︎

  2. This GitHub issue gave me the solution. You can automatically access your RSS feed because RSS is enabled by default. ↩︎