Upgrade social links from Ananke 2.10 or earlier
Ananke 2.11.0 replaced the social settings. Later releases ignore the old settings, so a site that still uses them shows no follow links. This guide moves your settings to the current structure.
Find the old settings #
Ananke 2.10 and earlier read two forms. Search your site configuration for both:
A list of tables named
ananke_socials:toml# config/_default/params.toml (old) [[ananke_socials]] name = "github" url = "https://github.com/jdoe"A flat parameter with the network name, for example
github = "https://github.com/jdoe"directly under[params]. Ananke 2.10 read these names:facebook,twitter,instagram,youtube,github,gitlab,keybase,linkedin,medium,mastodon,slack,stackoverflow, andrss.
Move the settings #
Add each network to the follow list, in the order that you want:
toml# config/_default/params.toml [ananke.social.follow] networks = ["github"]Add a table for each network and copy the old
urltoprofilelink:toml# config/_default/params.toml [ananke.social.github] profilelink = "https://github.com/jdoe"Instead of
profilelink, you can setusernamefor networks with a fixed profile address. The built-in networks table shows which networks support this.If an old entry set
label, copy it to the same table. If it setcolor, set it in the network definition instead, for examplecolorunder[ananke.social.networks.github].Delete the
ananke_socialstables and the flat network parameters.Run
hugo serverand check the follow links in the header and the footer.
To add share links too, see Add share links.
Update your own templates #
Ananke 2.11.0 also removed the old social partials and the functions in partials/func/socials/. If your own templates call them, change the calls:
| Old call | New call |
|---|---|
{{ partial "social-follow.html" . }} | {{ partial "social/follow.html" . }} |
{{ partial "social-share.html" . }} | {{ partial "social/share.html" . }} |