Add a rel
option to social registers (#596)
* Add a `rel` option to social registers Fixes #417 * Fix typo
This commit is contained in:
parent
b393088d09
commit
6b66dc32d4
|
@ -135,7 +135,7 @@ In order to register a service to be used, user must add an `ananke_socials` par
|
||||||
- name*: It matches the built-in service reference (Ex: twitter, github)
|
- name*: It matches the built-in service reference (Ex: twitter, github)
|
||||||
- url*: The url of the handle's profile on the service (Ex: https://twitter.com/theNewDynamic, https://github.com/
|
- url*: The url of the handle's profile on the service (Ex: https://twitter.com/theNewDynamic, https://github.com/
|
||||||
theNewDynamic)
|
theNewDynamic)
|
||||||
|
- rel: Optional. Allows to add a `rel` attribute to the follow link. Useful for Mastodon verification which requires a `rel="me"` on the link.
|
||||||
```yaml
|
```yaml
|
||||||
params:
|
params:
|
||||||
ananke_socials:
|
ananke_socials:
|
||||||
|
@ -143,6 +143,9 @@ params:
|
||||||
url: https://twitter.com/theNewDynamic
|
url: https://twitter.com/theNewDynamic
|
||||||
- name: github
|
- name: github
|
||||||
url: https://github.com/theNewDynamic
|
url: https://github.com/theNewDynamic
|
||||||
|
- name: mastodon
|
||||||
|
url: https://social.example.com/@username
|
||||||
|
rel: me
|
||||||
```
|
```
|
||||||
|
|
||||||
If user needs to overwrite default `color` and `label` of the service, they simply need to append the following to the entry:
|
If user needs to overwrite default `color` and `label` of the service, they simply need to append the following to the entry:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{ $socials := where (partialCached "func/socials/Get" "socials/Get") "follow" "!=" false }}
|
{{ $socials := where (partialCached "func/socials/Get" "socials/Get") "follow" "!=" false }}
|
||||||
<div class="ananke-socials">
|
<div class="ananke-socials">
|
||||||
{{ range $socials }}
|
{{ range $socials }}
|
||||||
<a href="{{ .url }}" target="_blank" class="{{ .name }} ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l {{ cond (eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" }}" title="{{ .label }} link" rel="noopener" aria-label="follow on {{ .label }}——Opens in a new window">
|
<a href="{{ .url }}" target="_blank" {{ with .rel }} rel="{{ . }}" {{ end }} class="{{ .name }} ananke-social-link link-transition stackoverflow link dib z-999 pt3 pt0-l {{ cond (eq $.Site.Language.LanguageDirection "rtl") "ml1" "mr1" }}" title="{{ .label }} link" rel="noopener" aria-label="follow on {{ .label }}——Opens in a new window">
|
||||||
{{ with .icon }}
|
{{ with .icon }}
|
||||||
<span class="icon">{{ . }}</span>
|
<span class="icon">{{ . }}</span>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
|
Loading…
Reference in a new issue