Google +1 Button for Pebble Blog

You basically need to change 2 files to add the Google +1 button to the Pebble Blog.

First, add the Google +1 button javascript code at the end of your favorite template. This should be located somewhere around themes/your-theme/template.jsp

<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
</script>
<script type="text/javascript">
   (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>

Second, set the button tag within the entry Java server page. So it does appears right behind the title of each blog entry. You will find the file in WEB-INF/jsp/blogEntry.jsp

<h1>
<a href="${blogEntry.permalink}">${blogEntry.title}</a>&nbsp;
<g:plusone size="small" href="${blogEntry.localPermalink}"></g:plusone>

</h1>

Advertisement