diff options
author | Regis Philibert <login@regisphilibert.com> | 2022-05-06 18:26:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 18:26:54 +0300 |
commit | a98a70782c8d87c7e66fd5d4b537377dd40c515e (patch) | |
tree | 48c0368dfee66e3169f6664dd0f99b55982cf8b6 | |
parent | 7b472d461c311f2aa16f9dfa67cc31e0aa47a0f2 (diff) |
Enable/Disable Social follow/share per service (#550)
* This allows user to set `follow: false` on a service to see it removed from the list of socials throughout.
Fixes #547
* Update README
-rw-r--r-- | README.md | 15 | ||||
-rw-r--r-- | layouts/partials/social-follow.html | 2 |
2 files changed, 16 insertions, 1 deletions
@@ -161,6 +161,21 @@ params: color: '#ff6800' ``` +#### Limit Follow or Share + +If a user needs to control Share and Follow of a service, for example enabling "Share on Facebook" without having a Facebook Page to "follow", they can set `follow: false` one the registered service. + +```yaml +params: + ananke_socials: + - name: facebook + label: Facebook + follow: false + - name: twitter + url: https://twitter.com/theNewDynamic + label: TND Twitter +``` + #### Social Icons Customization 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. diff --git a/layouts/partials/social-follow.html b/layouts/partials/social-follow.html index d651ad6..7e3f920 100644 --- a/layouts/partials/social-follow.html +++ b/layouts/partials/social-follow.html @@ -1,4 +1,4 @@ -{{ $socials := partialCached "func/socials/Get" "socials/Get" }} +{{ $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"> |