Adding a Mastodon link to social menu of the Minimo theme

At the time of writing the Minimo theme for Hugo doesn’t have an option to include a Mastodon link in the social networking menu, after some trial and error I managed to get it working:

First we add an svg icon.
I took the Mastodon logo from here and edited it with Inkscape. I extracted the paths with a text editor and did some manual editing.

Inserted in themes/minimo/layouts/partials/svg/icons.html

...
{{ else if eq "mastodon" . }}
  <path transform="translate(2) scale(0.9)" d="m 21.180754,14.71751 c -0.31812,1.63663 -2.84925,3.42775 -5.75625,3.77488 -1.51587,0.18087 -3.00837,0.34712 -4.59987,0.27412 -2.6027495,-0.11925 -4.6564995,-0.62125 -4.6564995,-0.62125 0,0.25338 0.0156,0.49463 0.0469,0.72025 0.33838,2.56863 2.547,2.7225 4.6391295,2.79425 2.11162,0.0722 3.99187,-0.52062 3.99187,-0.52062 l 0.0867,1.909 c 0,0 -1.477,0.79312 -4.10812,0.939 -1.4508795,0.0798 -3.2523795,-0.0365 -5.3506295,-0.59188 -4.55075,-1.2045 -5.333375,-6.05537 -5.453125,-10.97737 -0.0365,-1.46138 -0.014,-2.83938 -0.014,-3.99188 0,-5.033 3.297625,-6.50825 3.297625,-6.50825 1.66275,-0.76362 4.51588,-1.08475 7.4819995,-1.109 h 0.0729 c 2.96612,0.0242 5.82112,0.34538 7.48375,1.109 0,0 3.2975,1.47525 3.2975,6.50825 0,0 0.0414,3.71338 -0.45988,6.2915" />

  <path transform="translate(2) scale(0.9)" d="m 17.751004,8.81646 v 6.09413 h -2.41437 v -5.915 c 0,-1.24688 -0.52463,-1.87975 -1.574,-1.87975 -1.16025,0 -1.74175,0.75075 -1.74175,2.23525 v 3.23762 H 9.6207545 v -3.23762 c 0,-1.4845 -0.58162,-2.23525 -1.74187,-2.23525 -1.04938,0 -1.574,0.63287 -1.574,1.87975 v 5.915 h -2.41438 v -6.09413 c 0,-1.2455 0.31713,-2.23525 0.95413,-2.9675 0.65687,-0.73225 1.51712,-1.10762 2.585,-1.10762 1.2355,0 2.17112,0.47487 2.7897495,1.42475 l 0.60137,1.00812 0.6015,-1.00812 c 0.6185,-0.94988 1.55413,-1.42475 2.78975,-1.42475 1.06775,0 1.928,0.37537 2.585,1.10762 0.63688,0.73225 0.954,1.722 0.954,2.9675" />
...

If you want all of the code above, copy and paste are your friends.

Next Mastodon needs to join the list of social networks in the footer.
I like Mastodon so I put it at the front of the list.

Inserted in: themes/minimo/data/config/default/widgets.toml

[social_menu]
title = ""
platforms = ["mastodon","github","facebook","twitter","instagram","email","codepen","gitlab","linkedin","telegram","google_scholar","youtube"]

We still need a prefix for the link.
Because Mastodon isn’t tied to a single domain, this part is extremely simple but if we leave it out, the link will start with <nil> which isn’t very helpful.

Inserted in: themes/minimo/data/theme.toml

mastodon = "https://"

This concludes the modifications to the theme.

Now I can add my own Mastodon account to the params.social section of config.toml.
Both instance and account are required.

Inserted in config.toml:

[params.social]
...
mastodon = "mastodon.social/@jollymnemonic"

And that’s all there is to it. Scroll to the bottom of this page to see the end result.