mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 17:22:46 +00:00
layouts: add support for setting additional relations on social links
This commit is contained in:
parent
b393088d09
commit
7b6006227f
12
README.md
12
README.md
@ -181,6 +181,18 @@ params:
|
||||
On top of easily customizing the built-in services' label and color, user can overwrite their icon by adding an svg file at `/assets/ananke/socials` with a filename matching the service's name.
|
||||
For example, in order to use your own GitHub icon, simply add an svg file at `/assets/ananke/socials/github.svg`
|
||||
|
||||
#### Additional relations
|
||||
|
||||
You can add extra relations to the social links via the `rel:` property. This can be used to assert ownership of the linked account as described in the [rel="me" mircroformat](https://microformats.org/wiki/rel-me).
|
||||
|
||||
```yaml
|
||||
params:
|
||||
ananke_socials:
|
||||
- name: twitter
|
||||
url: https://twitter.com/theNewDynamic
|
||||
rel: me
|
||||
```
|
||||
|
||||
#### Built-in Services
|
||||
Here is the list of built-in services. Those marked with an `*` are also part of the "Share" module.
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
String (.label)
|
||||
String (.color)?
|
||||
Bool (.share)?
|
||||
String (.rel)?
|
||||
@uses
|
||||
- partial
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{ $socials := where (partialCached "func/socials/Get" "socials/Get") "follow" "!=" false }}
|
||||
<div class="ananke-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" 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{{ with .rel }} {{ . }}{{ end }}" aria-label="follow on {{ .label }}——Opens in a new window">
|
||||
{{ with .icon }}
|
||||
<span class="icon">{{ . }}</span>
|
||||
{{ else }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user