My other Hugo blog's feed isn't rendering properly

I recently started a self-hosted Hugo blog here: https://lichen.eilloh.net

I’ve put the following feed into the Mirco.blog’s feed field: https://lichen.eilloh.net/blog/index.xml

But the import doesn’t work. It will only grab the first paragraph, not the whole thing.

And it doesn’t import the formatting so the post is all squished together and nearly unreadable.

Compare the original post: https://lichen.eilloh.net/blog/terminalcommands/

To the mess that was imported: https://blog.eilloh.net/2022/12/05/terminal-commands.html

I don’t understand this since they’re both Hugo blogs, both using markdown - why would it truncate the post and lose all the formatting? Is this a problem with my blog? Or with micro.blog?

The RSS feed only contains post excerpts with HTML stripped. Here’s what the post from your example looks like in the feed:

<description>Trying to learn about computers at the age of 48 is sometimes hilarious. Me: Okay so how do you learn terminal commands? Is that the CS50 course at Harvard? Because I don&rsquo;t really enjoy programming so I&rsquo;m not sure if I should keep going with that - do we learn other things later? Is that where I&rsquo;d learn terminal commands? I can skip ahead, it&rsquo;s a free course. Greg (husband of 27 years, software developer): Probably, yes, they&rsquo;ll get to that.</description>

The person(s) who implemented the default Hugo RSS template decided to only include post summaries. To fix this, you will have to override that template with your own and include entire posts: HTML and all.

1 Like

Oh no! I had no idea.

I hugely appreciate the links, thank you so much @sod!

Will continue tinkering…

1 Like

I was a bit confused implementing the default template because my code didn’t exactly match. But based on this I was able to do some sleuthing!

Turns out it was as simple as putting the following into my config.yaml file:

params:
  ShowFullTextinRSS: true

Which I found here: Setting up an RSS feed for a Hugo blog using the PaperMod Theme | by Erica Pisani | Medium

Woohoo! :partying_face: Nice work, @hollie.

To anyone ending up here in the future: this is a feature specific to the PaperMod theme. It already provides a custom RSS template with support for full-length posts. If your blog uses another theme, the ShowFullTextinRSS parameter might be named differently or not exist at all.

2 Likes

I’m having difficulties getting the RSS feed from my personal Hugo website (also uses the PaperMod theme) to show up in Micro.blog and get cross-posted to BlueSky, Mastodon, and Threads.

RSS feed is here: Joshua P. Steele

Here’s the relevant code from my hugo.yaml:

outputs:
  home:
    - HTML
    - RSS
    - JSON
outputFormats:
  RSS:
    mediaType: application/rss+xml
    baseName: feed

I strongly recommend using a JSON feed instead.

You can see the raw layouts for that here: theme-blank/layouts/index.json at master · microdotblog/theme-blank · GitHub

And add it as an output format:

@jsonbecker I see that my Hugo PaperMod theme says to include outputs.home.JSON in my hugo.yaml file in order to enable search functionality. So I’ve got a JSON feed that gets generated here: https://joshuapsteele.com/index.json. But that doesn’t seem to work with Micro.blog, either.

Ultimately, I’m not 100% sure what to put in my /layouts and hugo.yaml to accomplish what you’re suggesting.

(Hugo rookie here. Source code for my site is here: GitHub - joshuapsteele/joshuapsteele.github.io)

I’m guessing I need to add a custom layout like the microdotblog/theme-blank/layouts/index.json to my code somewhere, so that my site generates a JSON feed that Micro.blog can interpret correctly. But I’m also guessing I need to leave my /themes/PaperMod/layouts/_default/index.json file alone, so that it doesn’t bork my site’s search functionality.

Also, if possible, I’d just like my JSON feed for Micro.blog (and my RSS feed for everyone else) to include all my stuff under /content/blog

Your layout is a little funky and build process isn’t what I do locally, but:

  1. Your Layout for PaperMod/layouts/_default/index.json is a bunch of JSON, but it’s not a to-spec JSONFeed. It’s being generated for search (and is frustrating honestly that it exists. Boo on them).
  2. The easiest thing would be to create a new layout called something like posts.json and add it as an output format. See the things named like “ArchiveJSON” in the Micro.blog configuration I linked to? You can provide a path and a name and all that to have your secondary JSON feed for micro.blog the same way the PhotosJSON or ArchiveJSON are made.
  3. For feed filtering, I’d recommend distingushing a type-- then you’d have to add a filter where you’re getting your .Pages value on RSS – note how this is done on Micro.blog but you can do other filters: theme-blank/layouts/index.xml at f69fcae6d15ce9dbbd489cd1b33eb24418d6ae6c · microdotblog/theme-blank · GitHub

For what it’s worth, PaperMod is an incredibly complex theme to run on your own and customize and not a great choice for a novice IMO. I’ve been using Hugo for like 10 years and struggle to follow all of its features, and I’ve built several (less complex) themes from scratch.

Getting help on PaperMod you’ll be more successful on the Hugo forums, especially since you’re building outside of Micro.blog and none of what you’re asking about (though not obvious) is actually Micro.blog specific.