feat(): add support for Twitter and Facebook share buttons
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{{ partial "top.html" . }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
<h4>Publié le {{ dateFormat "01-02-2006 15:04:05" .Date }}</h4>
|
||||
{{ partial "share.html" . }}
|
||||
<article>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
|
||||
21
layouts/partials/share.html
Normal file
21
layouts/partials/share.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!-- Share on Twitter -->
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-via="kendo5731"></a>
|
||||
<script>!function (d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
|
||||
if (!d.getElementById(id)) {
|
||||
js = d.createElement(s);
|
||||
js.id = id;
|
||||
js.src = p + '://platform.twitter.com/widgets.js';
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}
|
||||
}(document, 'script', 'twitter-wjs');</script>
|
||||
|
||||
<div class="fb-share-button" data-href="{{ .Permalink }}" data-layout="button"></div>
|
||||
<div id="fb-root"></div>
|
||||
<script>(function(d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) return;
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.5";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));</script>
|
||||
Reference in New Issue
Block a user