Added Google+ buttons to blog posts

This commit is contained in:
Gergely Polonkai 2012-12-20 15:25:44 +01:00
parent d3383b2883
commit d9487c8b58
3 changed files with 18 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/*
/*
Document : blog
Created on : 2012.09.14., 14:53:34
Author : polonkai.gergely
@ -18,4 +18,9 @@ p.article-date {
.paginator {
margin: .5em 0;
}
.plusone-container {
margin-left: 1em;
display: inline;
}

View File

@ -1,5 +1,5 @@
<div class="post">
<h3>{% if title_links %}<a href="{{ path('GergelyPolonkaiFrontBundle_blogViewPost', {year: post.createdAt|date('Y'), month: post.createdAt|date('m'), day: post.createdAt|date('d'), slug: post.slug}) }}">{% endif %}{{ post.title }}{% if title_links %}</a>{% endif %}</h3>
<h3>{% if title_links %}<a href="{{ path('GergelyPolonkaiFrontBundle_blogViewPost', {year: post.createdAt|date('Y'), month: post.createdAt|date('m'), day: post.createdAt|date('d'), slug: post.slug}) }}">{% endif %}{{ post.title }}{% if title_links %}</a>{% endif %}<div class="plusone-container"><div class="g-plusone" data-annotation="inline" data-size="small" data-width="300"></div></div></h3>
<p class="article-date">{{ post.createdAt|date('m-d-Y :: H:i') }} by {{ post.user.name }}</p>
{{ post.content|insert_code_chunks }}
{% if post.tags|length > 0 %}
@ -9,4 +9,5 @@
{% endfor %}
</p>
{% endif %}
<div class="g-plus" data-action="share"></div>
</div>

View File

@ -66,6 +66,16 @@
left: e.pageX + 5
});
});
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
</body>
</html>