summaryrefslogtreecommitdiff
path: root/_posts
diff options
context:
space:
mode:
authorKarl Hallsby <karl@hallsby.com>2021-06-17 01:28:41 -0500
committerKarl Hallsby <karl@hallsby.com>2021-06-17 01:28:41 -0500
commit6e4f7854c93a0c07d9b39ba98bd6176b9e86eb79 (patch)
tree3d0f7eaa8ae3d6d9d12604cbf04ce7d1ed4922a3 /_posts
parent6419a9ea158fc90a1af81e209bd30592df1a6bf3 (diff)
Add post about how to add RSS icon to TeXt Theme-d Jekyll site
Diffstat (limited to '_posts')
-rw-r--r--_posts/2021-06-17-jekyll-text-theme-rss.markdown52
1 files changed, 52 insertions, 0 deletions
diff --git a/_posts/2021-06-17-jekyll-text-theme-rss.markdown b/_posts/2021-06-17-jekyll-text-theme-rss.markdown
new file mode 100644
index 0000000..26f0d4a
--- /dev/null
+++ b/_posts/2021-06-17-jekyll-text-theme-rss.markdown
@@ -0,0 +1,52 @@
+---
+layout: article
+title: "Add RSS to TeXt Theme-d Jekyll Site"
+date: 2021-06-17
+categories: rss
+tags: [Jekyll, RSS, TeXt Theme]
+---
+Recently, I watched [DistroTube's](https://distrotube.com/) [video about Elfeed](https://www.youtube.com/watch?v=rkSZbzGpQuM&t=705s), which prompted me to set up RSS for my own website.
+However, after looking through the documentation for the [TeXt Theme](https://tianqi.name/jekyll-TeXt-theme/) for [Jekyll](https://jekyllrb.com/), 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](https://github.com/jekyll/jekyll-feed) to generate this file for you.
+
+1. Download the [RSS SVG image](https://upload.wikimedia.org/wikipedia/commons/4/46/Generic_Feed-icon.svg)[^1] to `/_includes/svg/icon/social/`, and name it `rss.svg`.
+ * The name is not important, so long as it is unique within this directory and memorable.
+
+2. Add the path to your `feed.xml` file to your `_config.yml` file.
+ I placed this under the `paths` set, but if you can eally place it anywhere.
+My `_config.yml` `paths` section now looks like this:
+``` yaml
+paths:
+ root: "/"
+ home: "/"
+ rss: "/feed.xml"
+```
+
+3. 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` and `include .../rss.svg` can be replaced with your own values.
+ In the snippet provided, the code I use is shown, so the `href="..."` and `include ...` are values that I set for myself.
+
+<!-- Need the raw block to prevent liquid from interpolating the brace stuff. -->
+{% raw %}
+``` html
+{%- 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 -%}
+```
+{% endraw %}
+
+---
+
+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](https://github.com/kitian616/jekyll-TeXt-theme), so that this "workaround" is no longer needed.
+
+[^1]: The RSS SVG logo is licensed with: GPL, LGPL, MPL, MTL.