diff --git a/exampleSite/content/post/chapter-6.md b/exampleSite/content/post/chapter-6.md index c767196..4750783 100644 --- a/exampleSite/content/post/chapter-6.md +++ b/exampleSite/content/post/chapter-6.md @@ -4,6 +4,7 @@ description: "Esmeralda" featured_image: "/images/esmeralda.jpg" tags: [] title: "Chapter VI: Esmeralda" +disable_share: false --- We are delighted to be able to inform the reader, that during the whole of this scene, Gringoire and his piece had stood firm. His actors, spurred on diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 648a45e..a940308 100755 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -14,7 +14,8 @@ */}} {{with .CurrentSection.Title }}{{. | upper }}{{end}} -

+ {{ partial "social-share.html" . }} +

{{- .Title -}}

{{ with .Params.author }} @@ -32,6 +33,7 @@ + {{/* Show "reading time" and "word count" but only if one of the following are true: 1) A global config `params` value is set `show_reading_time = true` diff --git a/layouts/partials/social-share.html b/layouts/partials/social-share.html new file mode 100644 index 0000000..0b72915 --- /dev/null +++ b/layouts/partials/social-share.html @@ -0,0 +1,26 @@ +{{ $title := .Title }} +{{ $url := printf "%s" .URL | absLangURL }} +{{ $icon_size := "32px" }} + +{{ if not .Params.disable_share }} +
+ + {{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }} + + {{ partialCached "svg/facebook.svg" (dict "size" $icon_size) $icon_size }} + + + {{ $twitter_href := printf "https://twitter.com/share?url=%s&text=%s" $url $title }} + {{ with .Site.Social.twitter }} + {{ $twitter_href = printf "%s&via=%s" $twitter_href . }} + {{ end }} + + {{ partialCached "svg/twitter.svg" (dict "size" $icon_size) $icon_size }} + + + {{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }} + + {{ partialCached "svg/linkedin.svg" (dict "size" $icon_size) $icon_size }} + +
+{{ end }} \ No newline at end of file