many many many Varia's websites, work in progress: https://many.vvvvvvaria.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
776 B

# -*- coding: utf-8 -*-
"""
Google Comments Plugin For Pelican
==================================
Adds Google comments to Pelican
"""
from pelican import signals
googleplus_comments_snippet = """
<script src="https://apis.google.com/js/plusone.js"></script>
<script>
$(document).ready(function () {
gapi.comments.render('comments', {
href: window.location,
width: '600',
first_party_property: 'BLOGGER',
view_type: 'FILTERED_POSTMOD'
});
});
</script>
"""
def add_googleplus_comments(generator, metadata):
metadata["googleplus_comments"] = googleplus_comments_snippet
def register():
signals.article_generator_context.connect(add_googleplus_comments)