How I Automatically Include a Blog Description in My RSS Feed
I’ve been asked a couple of times how I get this short site description to be included in every entry of my RSS feed.
HeyDingus is a blog by Jarrod Blundy about technology, the great outdoors, and other musings. If you like what you see — the blog posts, wallpapers, shortcuts, scripts, or anything — please consider leaving a tip, checking out my store, or just sharing my work. Your support is much appreciated!
Well, in case it helps anyone else, here’s how!
I actually pondered the same question for quite a while when reading the Basic Apple Guy and MacStories RSS feeds, which include similar regular descriptors. I can’t speak to how those sites accomplish it, but I figured out that I could use the templating system in Blot, my website host, to call up that blurb in multiple places.
Blot uses the Mustache templating system, so other hosts that also use Mustache could probably piggyback off this method directly. Different template systems might require more tweaks, but I’m fairly confident the same result could be achieved in Hugo or elsewhere.
Anyway, for Blot, I first made a new text file called
blogblurg.html and wrote out that paragraph you see at the bottom of every page on my website. You’ll notice that it’s written in HTML, not Markdown.
blogblurg.htmlin iA Writer ⌘
Then, to make it show up, I call that template in the footer template (
footer.html). That’s when I realized I could do the same thing within my RSS template. I edited that
feed.rss file so that right after the body of each item it adds a horizontal rule and then the very same blurb.
> blogblurb, do all the work to pull in the content for each entry. ⌘
Now, each time I publish something, I know that the reader will see that little write-up — either in the footer of my website if they are reading on the web, or in each entry of my RSS feed. And if I ever want to change the wording or update a link, I just edit the
blogblurb.html file and it’s updated everywhere.