Follow

Adapted solution to display Mastodon/Fediverse discussion as a system of comments in a static Hugo blog.

f1rum.fr/posts/hugo-masto-comm

· · Web · 3 · 0 · 0

@F1RUM thanks for sharing! I've implemented this as a shortcode and then add {{< comments >}} to each post where I'd like to have comments enabled (I need to add some front matter anyway). This way I don't have to modify the theme template.

@do1mj interesting too !
it's a mess when you begin to edit your theme, it becomes complicated to grab the theme developer updates

@do1mj I'm very insterrested by the way you define your {{<comments>}} block as a shortcode.
I would implement this on another blog without touching the theme.
Tnx for your help

@F1RUM it's very easy to do. Just put your HTML into layouts/shortcodes/comments.html

You only need to change the first line to:

```{{ with .Page.Params.comments }}```

the rest could stay the same. You can also move your I18N toml files to the i18n/ directory of your Hugo project and you should be good to go.

@F1RUM question, when writing a blog post, do you have to manually add the toot that will be linked in the blog each time ?

Sign in to participate in the conversation
Mastodon.Radio

Mastodon.Radio is a community space for the Amateur (Ham) Radio community. It's entirely funded by its users. Come join us and talk radio, technology, and more!