Show recommendations with RSS feed?

I follow the steps on the Recommendations documentation to show my blogroll. I use a hidden test page on recommendations | Frank Meeuwsen to try the options.

The code {{< blogroll >}} works perfectly fine, but I’d like to have more flexibility in how to show the list. I’d like to have it as it is on Blogroll with the RSS feed included.

I tried the code from the documentation:

{{ range .Site.Data.blogrolls.recommendations }}
   <p>{{ .name }}</p>
{{ end }}

but I’m not sure how to implement this on a page? Just copy and paste doesn’t do anything. Any help or example code is appreciated!

I don’t think Hugo code works in a page. The {{< blogroll >}} is considered a shortcode that works.

That’s right. There are essentially two approaches for a custom blogroll design:

  • Customize the CSS for the existing blogroll shortcode.
  • Create a new shortcode that can be used in pages.

If you want full control over this, the second option is the way to go. It sounds harder than it is. Here are the basic steps:

  • Go to Design → Edit Themes → New Plug-in. Give it a name, leave the URL blank, make sure the selected blog is correct.
  • On the themes page, scroll down to the plug-ins section and click on the new plug-in you created to edit it.
  • Create a template with the path “layouts/shortcodes/myblogroll.html”.
  • In the text content of the template, you can put the {{ range …}} code you have above or anything else you’d like.

Then in a blog post or page, you can use {{< myblogroll >}}.

2 Likes

I also think we’ll continue to add parameters to the default blogroll shortcode to make it easier to customize. For example, an option to hide the domain name maybe. Let us know what would be useful.

1 Like

Is this list available in the official documentation? It would be a good addition for helping with blogrolls, shortcodes, and plug-ins.

These instructions are identical to how you make any shortcode in Hugo-- the only difference is Manton recommending you do it as a plug in so that you can take it with you if you change themes versus directly customizing it in your theme, which also works.

I bring this up only to say that there is continued confusion in the community thinking themes and customization are a Micro.blog thing whereas it’s about 98% a Hugo thing. The micro.blog specific portion of this is the structure of the data Micro.blog saves to represent a blog roll-- from there everything is Hugo.

Yeah. The Hugo documentation can often be difficult to sort through, so I think if we document more on Micro.blog too, it can’t hurt. I was thinking of making a video just showing the above steps.

Perhaps we also need a “Micro.blog and Hugo” help page that links to the relevant Hugo docs.

1 Like

I agree-- but I also think that people would have so much more success if they Googled for Hugo, used ChatGPT for Hugo stuff, and searched their forums than they often find here.

I’ve been thinking a lot about the microhooks setup of the TinyTheme and how that would make it potentially much easier to separate out the Micro.blog specific parts (which I think has already been greatly improved) and gives some clear pointers to folks on how to modify more specific parts of themes.

But in the end, I think if you want to modify your theme you’re going to have a much worse time if you resist learning at least basic Hugo stuff.

This works great! One more question, are there more variables available next to name and url? Is the RSS url available as well? I tried to figure this out with help from Perplexity.ai but I find it hard to define the proper question :slight_smile:

Most AI tools probably aren’t current enough to understand this. I’d love to have a Micro.blog-focused GPT on ChatGPT that knew our help and Hugo’s documentation backwards and forwards.

As for your questions, here are the current fields available there:

  • name
  • url
  • about
  • created_at
  • updated_at

RSS is missing, but we do have it recorded internally (and it’s in the OPML file) so I’ll add it this week so it’s available to Hugo too. Thanks!

1 Like

Maybe it is nice to know Perplexity used and referenced your blogpost as a source in search for an answer :slight_smile: (see “sources > view more” in the link)

1 Like

This is really impressive. Glad to see my posts are being picked up Perplexity! Although it does point to another issue in that sometimes I document things on my blog that aren’t fully explained in our actual docs.

This would be a great use to create one @numericcitizen. I’ve heard of companies uploading their HR manual and other operating procedures docs so that people can ask questions and get “friendlier” answers that are more helpful.

I’ve now added a new field feed_url. I’ll update the documentation.

What do you mean, exactly? I’m not sure to understand your idea here…