Merge pull request #66 from jswh/master

add doushuo
This commit is contained in:
Alexandre Vicenzi 2017-01-11 21:01:54 -02:00 committed by GitHub
commit 23a0e8cdb4
2 changed files with 16 additions and 0 deletions

View file

@ -77,5 +77,6 @@
{% endif %}
{% include "partial/disqus.html" %}
{% include "partial/duoshuo.html" %}
</article>
{% endblock %}

View file

@ -0,0 +1,15 @@
{% if DUOSHUO_SITENAME %}
<div class="ds-thread" data-thread-key="{{ article.slug }}" data-title="{{ article.title }}" data-url="{{ SITEURL }}/{{ article.url }}"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:'{{ DUOSHUO_SITENAME }}'};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
{% endif %}