Skip to content

Commit

Permalink
Enable/Disable Social follow/share per service (theNewDynamic#550)
Browse files Browse the repository at this point in the history
* This allows user to set `follow: false` on a service to see it removed from the list of socials throughout.

Fixes theNewDynamic#547

* Update README
  • Loading branch information
regisphilibert authored and tstephen committed Jun 9, 2022
1 parent 875fe07 commit 0166933
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/social-follow.html
Original file line number Diff line number Diff line change
@@ -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">
Expand Down

0 comments on commit 0166933

Please sign in to comment.