mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-07 16:42:45 +00:00
theme(fix): deprecated: .Site.Social
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
This commit is contained in:
parent
321680f6ee
commit
41d183a034
@ -207,6 +207,7 @@ params:
|
|||||||
label: Facebook
|
label: Facebook
|
||||||
follow: false
|
follow: false
|
||||||
- name: twitter
|
- name: twitter
|
||||||
|
username: theNewDynamic
|
||||||
url: https://twitter.com/theNewDynamic
|
url: https://twitter.com/theNewDynamic
|
||||||
label: TND Twitter
|
label: TND Twitter
|
||||||
```
|
```
|
||||||
|
@ -39,3 +39,4 @@ enableRobotsTXT = true
|
|||||||
[[params.ananke_socials]]
|
[[params.ananke_socials]]
|
||||||
name = "twitter"
|
name = "twitter"
|
||||||
url = "https://twitter.com/GoHugoIO"
|
url = "https://twitter.com/GoHugoIO"
|
||||||
|
username = "GoHugoIO"
|
||||||
|
@ -3,8 +3,10 @@
|
|||||||
|
|
||||||
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }}
|
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }}
|
||||||
{{ $twitter_href := printf "https://twitter.com/intent/tweet?url=%s&text=%s" $url $title }}
|
{{ $twitter_href := printf "https://twitter.com/intent/tweet?url=%s&text=%s" $url $title }}
|
||||||
{{ with site.Social.twitter }}
|
|
||||||
{{ $twitter_href = printf "%s&via=%s" $twitter_href . }}
|
{{ $twitterSetup := first 1 (where site.Params.ananke_socials "name" "twitter") }}
|
||||||
|
{{ with index $twitterSetup 0 }}
|
||||||
|
{{ $twitter_href = printf "%s&via=%s" $twitter_href .username }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }}
|
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }}
|
||||||
{{ $hrefs := dict "facebook" $facebook_href "twitter" $twitter_href "linkedin" $linkedin_href }}
|
{{ $hrefs := dict "facebook" $facebook_href "twitter" $twitter_href "linkedin" $linkedin_href }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user