Recently, I watched DistroTube's video about Elfeed, which prompted me to set up RSS for my own website. However, after looking through the documentation for the TeXt Theme for Jekyll, I found there was no out-of-the-box support for adding RSS to the bottom of the page.
In this post, I give the steps required to add the small RSS logo to the footer of your page and the appropriate HTML/Liquid code to add to implement a small RSS button in the footer of your webpage which links back to your feed.xml
file.
I assume that you are already using the TeXt Theme, but if you are not, then this guide can still be useful, although you will have to figure out the proper locations for the RSS SVG and the button inclusion snippet yourself.
I also assume that you either already have a feed.xml
file or are simultaneously setting up jekyll-feed to generate this file for you.
- Download the RSS SVG image[^1] to
/_includes/svg/icon/social/
, and name itrss.svg
.
- The name is not important, so long as it is unique within this directory and memorable.
- Add the path to your
feed.xml
file to your_config.yml
file. I placed this under thepaths
set, but if you can eally place it anywhere. My_config.yml
paths
section now looks like this:
paths:
root: "/"
home: "/"
rss: "/feed.xml"
- Add the following snippet to the
_includes/author-links.html
file, wherever you want it.
- The order you place the block below determines which logos are presented in which order.
- The
href
andinclude .../rss.svg
can be replaced with your own values. In the snippet provided, the code I use is shown, so thehref="..."
andinclude ...
are values that I set for myself.
{%- if site.paths.rss -%}
<li title="{{ _locale_string_follow | replace: '[NAME]', 'RSS' }}">
<a class="button button--circle rss-button" itemprop="sameAs" href="{{ url }} {{ site.paths.rss }}" target="_blank">
<div class="icon">{%- include svg/icon/social/rss.svg -%}</div>
</a>
</li>
{%- endif -%}
And in theory, that should be it! Congratulations!<br> With this being such a simple change, I will look into getting this functionality merged into the main TeXt Theme package on GitHub, so that this "workaround" is no longer needed.
[^1]: The RSS SVG logo is licensed with: GPL, LGPL, MPL, MTL.