mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Regis Philibert
23.50.2021 57e38aad389fb114d82e98591d64b5abeba758c9
Make `disable_share` settings on both page and site level (#465)

Fixes #438
2 files modified
6 ■■■■■ changed files
README.md 4 ●●● patch | view | raw | blame | history
layouts/partials/social-share.html 2 ●●● patch | view | raw | blame | history
README.md
@@ -129,7 +129,7 @@
### Social Follow + Share
The theme automatically adds "Follow" link icons to the header and footer and "Share" link icons to pages unless `disable_share` site parameter is set to true. Each built-in services sports a label, an icon and a color.
The theme automatically adds "Follow" link icons to the header and footer and "Share" link icons to pages unless `disable_share` parameter is set to true either on the site level (site params) or page level (front matter). Each built-in services sports a label, an icon and a color.
In order to register a service to be used, user must add an `ananke_socials` parameter to its project configuration file and list them through it in the desired order. Each entry must bear a 
- name*: It matches the built-in service reference (Ex: twitter, github)
@@ -220,6 +220,8 @@
#### Custom CSS
WARNING: Pending resolution of this [discussion](https://github.com/theNewDynamic/gohugo-theme-ananke/discussions/452#discussioncomment-1865301), Custom CSS only works with Hugo Extended
In order to complement the default CSS with your own, you can add custom css files to the project. 
1. Just add a `assets/ananke/css` directory to your project and add the file(s) in it.
layouts/partials/social-share.html
@@ -10,7 +10,7 @@
{{ $hrefs := dict "facebook" $facebook_href "twitter" $twitter_href "linkedin" $linkedin_href }}
{{ $services := where (partialCached "func/socials/Get" "socials/Get") "share" true }}
{{ if not .Params.disable_share }}
{{ if not ($.Param "disable_share") }}
  <div id="sharing" class="mt3 ananke-socials">
    {{ range $service :=  $services }}
      {{ $href := index $hrefs .name }}