theNewDynamic / gohugo-theme-ananke

Ananke: A theme for Hugo Sites
https://gohugo-ananke-theme-demo.netlify.com/
MIT License
1.1k stars 1.13k forks source link

layouts: add support for setting additional relations on social links #591

Closed jhenstridge closed 1 year ago

jhenstridge commented 1 year ago

This is an attempt to allow setting rel="me" on social links in the page header/footer. I hadn't noticed #587 when writing this, so consider it an alternative proposal to fix the problem.

This PR adds a new rel attribute to services listed under ananke_socials. If set, it specifies additional relations that will be added to the corresponding social link. This should cover case of claiming ownership of a Mastodon account, while also handling any other relations the user might want to add:

ananke_socials:
  - name: mastodon
    url: ....
    rel: me

While I'm just using a simple string property, it's possible to add multiple new relations by treating it as a space separated list (e.g. rel: one two three). When used, it adds to the existing noopener relation rather than replacing it.

Fixes #417

netlify[bot] commented 1 year ago

Deploy Preview for gohugo-ananke-theme-demo canceled.

Name Link
Latest commit 7b6006227ff00eacd5239d4449c111ce13219bab
Latest deploy log https://app.netlify.com/sites/gohugo-ananke-theme-demo/deploys/637b0c150538080008539df0
regisphilibert commented 1 year ago

Terribly sorry I did not see his earlier... I rushed into fixing #417 myself without checking contributions... You'll find my solution is very similar to yours though.

Thanks a lot for this is much appreciated, and sorry again!