Merge pull request #255 from budparr/198-add-share-links
Add sharing links for the posts
This commit is contained in:
commit
81bc231eb4
|
@ -4,6 +4,7 @@ description: "Esmeralda"
|
||||||
featured_image: "/images/esmeralda.jpg"
|
featured_image: "/images/esmeralda.jpg"
|
||||||
tags: []
|
tags: []
|
||||||
title: "Chapter VI: Esmeralda"
|
title: "Chapter VI: Esmeralda"
|
||||||
|
disable_share: false
|
||||||
---
|
---
|
||||||
We are delighted to be able to inform the reader, that during the whole of
|
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
|
this scene, Gringoire and his piece had stood firm. His actors, spurred on
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
*/}}
|
*/}}
|
||||||
{{with .CurrentSection.Title }}{{. | upper }}{{end}}
|
{{with .CurrentSection.Title }}{{. | upper }}{{end}}
|
||||||
</aside>
|
</aside>
|
||||||
<h1 class="f1 athelas mb1">
|
{{ partial "social-share.html" . }}
|
||||||
|
<h1 class="f1 athelas mt3 mb1">
|
||||||
{{- .Title -}}
|
{{- .Title -}}
|
||||||
</h1>
|
</h1>
|
||||||
{{ with .Params.author }}
|
{{ with .Params.author }}
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
<time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
|
<time class="f6 mv4 dib tracked" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
|
||||||
{{- .Date.Format "January 2, 2006" -}}
|
{{- .Date.Format "January 2, 2006" -}}
|
||||||
</time>
|
</time>
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Show "reading time" and "word count" but only if one of the following are true:
|
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`
|
1) A global config `params` value is set `show_reading_time = true`
|
||||||
|
|
26
layouts/partials/social-share.html
Normal file
26
layouts/partials/social-share.html
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{{ $title := .Title }}
|
||||||
|
{{ $url := printf "%s" .URL | absLangURL }}
|
||||||
|
{{ $icon_size := "32px" }}
|
||||||
|
|
||||||
|
{{ if not .Params.disable_share }}
|
||||||
|
<div id="sharing" class="mt3">
|
||||||
|
|
||||||
|
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }}
|
||||||
|
<a href="{{ $facebook_href }}" class="facebook no-underline" aria-label="share on Facebook">
|
||||||
|
{{ partialCached "svg/facebook.svg" (dict "size" $icon_size) $icon_size }}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{{ $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 }}
|
||||||
|
<a href="{{ $twitter_href }}" class="twitter no-underline" aria-label="share on Twitter">
|
||||||
|
{{ partialCached "svg/twitter.svg" (dict "size" $icon_size) $icon_size }}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }}
|
||||||
|
<a href="{{ $linkedin_href }}" class="linkedin no-underline" aria-label="share on LinkedIn">
|
||||||
|
{{ partialCached "svg/linkedin.svg" (dict "size" $icon_size) $icon_size }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
Loading…
Reference in a new issue