feat(): add support for Twitter and Facebook share buttons
This commit is contained in:
parent
b8e812859e
commit
f5b5ae55d9
|
@ -6,7 +6,6 @@ A theme for [Hugo](https://gohugo.io/), inspired by Atom editor.
|
||||||
|
|
||||||
This repo is a work in progress, there is still work to do, contributions are welcome !
|
This repo is a work in progress, there is still work to do, contributions are welcome !
|
||||||
|
|
||||||
- Support Twitter and Facebook share buttons
|
|
||||||
- Support pagination in list layout
|
- Support pagination in list layout
|
||||||
- Support "dynamic" titles and descriptions
|
- Support "dynamic" titles and descriptions
|
||||||
- Uglify CSS and Javascript
|
- Uglify CSS and Javascript
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{{ partial "top.html" . }}
|
{{ partial "top.html" . }}
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<h4>Publié le {{ dateFormat "01-02-2006 15:04:05" .Date }}</h4>
|
<h4>Publié le {{ dateFormat "01-02-2006 15:04:05" .Date }}</h4>
|
||||||
|
{{ partial "share.html" . }}
|
||||||
<article>
|
<article>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</article>
|
</article>
|
||||||
|
|
|
@ -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>
|
|
@ -135,3 +135,7 @@ a {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fb-share-button iframe {
|
||||||
|
margin-top: -5px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue