probberechts / hexo-theme-cactus

:cactus: A responsive, clean and simple theme for Hexo.
https://probberechts.github.io/hexo-theme-cactus/
MIT License
3.06k stars 761 forks source link

social_links: Support multiple links per platform #348

Closed dharFr closed 1 year ago

dharFr commented 1 year ago

Hello,

social_links currently only allows on single link per service/platform, as the key must correspond to Fontawesome icon name.

This change proposal adds support for multiple links per service/platform. It allows users who have multiple accounts on a single service, which is quite frequent on Twitter or Mastodon for example, to list them all while using the correct Fontawesome icon. Optional custom label helps providing disambiguation between similar icon links, and also improves accessibility by adding a title attribute to the link.

For example:

social_links:
  -
    icon: mastodon
    label: "@alice@mastodon.social"
    link: https://mastodon.social/@alice
  -
    icon: mastodon
    label: "@alice@fosstodon.org"
    link: https://fosstodon.org/@alice

_config.yml becomes significantly more verbose, but also provides more flexibility for advanced users.

As an example, here is a screen-capture from my own website 👇

image

(mouse over the 1st mastodon icon displays the custom link title)

Best ^^