Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mattstratton/castanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/footer_scripts.html')
-rw-r--r--layouts/partials/footer_scripts.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/layouts/partials/footer_scripts.html b/layouts/partials/footer_scripts.html
index 9227ccf..bf2c464 100644
--- a/layouts/partials/footer_scripts.html
+++ b/layouts/partials/footer_scripts.html
@@ -10,8 +10,16 @@
share: "twitter", // name of share
label: "Tweet", // share button text (optional)
logo: "fab fa-twitter",
+ // The twitter link can be based in short ("arresteddevops") or
+ // long form ("https://twitter.com/arresteddevops")
+ // In long form we need to strip everything but the twitter handle
+ // for the 'via' parameter
{{ if (isset .Site.Params.social "twitter" )}}
- via: "{{ .Site.Params.social.twitter }}", // custom twitter sharing param 'via' (optional)
+ {{ if gt (len (urls.Parse .Site.Params.social.twitter).Scheme) 0 }}
+ via: "{{ trim ((urls.Parse .Site.Params.social.twitter).Path) "/" }}", // custom twitter sharing param 'via' (optional)
+ {{ else }}
+ via: "{{ .Site.Params.social.twitter }}", // custom twitter sharing param 'via' (optional)
+ {{ end }}
{{ end }}
url: "{{ .Permalink }}",
text: "{{ title .Title }}"