Hi,
I’m trying to set up a Mastodon commenting system for Zola but I’ve fallen at the first hurdle. How do you include something like this in config.toml? This is what’s used in Hugo.
[params]
[params.comment.fediverse]
enable = true
host = "mastodon.social"
user = "wordius"
Of course, Zola doesn’t support a Mastodon plugin itself. Though, I think you are asking where to save this, so your template can use it.
From the configuration doc page:
# You can put any kind of data here. The data
# will be accessible in all templates
# Example:
# [extra]
# author = "Famous author"
#
# author value will be available using {{ config.extra.author }} in templates
#
[extra]
You can, if you prefer, have subsections, such as:
[extra]
[extra.fediverse]
enable = true
host = "mastodon.social"
user = "wordius"
Which would be referenced as {{ config.extra.fediverse.user }}
in a template. Or config.extra.fediverse.enable
.
I don’t have much experience with Hugo, but I guess params
is similar to extra
, if params
are for the entire site.
Thanks for the rapid response, @ShawnPConroy.
First hurdle is cleared. Just have to figure the rest of the code to use and the ids for the posts I create.
Do the IDs need to be integer numbers, or can they be strings? You can a portion of the URL, the published date, or will you need to have a manual page_id
in the [extra]
frontmatter of each page?
No, I mean the Mastodon toot’s ID.
From what I’m looking at, you need to add an ID for a toot, post publishing, and then re-publish the post. So I’d have front matter something like this with the ID added for the Fediverse (Mastodon) at the end:
+++
Title = Title
Date = date
Tags
Fediverse = 123445566667777