Google Embed Pelican plugin

Technology ?? Comments Sun 23 March 2014

In my previous post, when discussing Embedly-cards, I enthusiastically exclaimed

The produced embeddable cards support almost any source - articles, Amazon products, YouTube videos, PDFs, forum posts, etc (even Google+ albums!).

Well, turns out I was getting a bit ahead of myself. After playing around with it a bit more, I found it doesn't deal so well with Google Maps and Places - useful embeddable objects if you are blogging whilst travelling, for example. So, after checking if anything better exists for Google Maps integration (and not finding anything whatsoever), I decided 'why not!'.

So, here is the result of an hour of procrastination: the Google-Embed Pelican plugin (disclaimer: there are more than likely a couple of bugs here and there - let me know if you come across any).

To install it, simply run

$ pip install google-embed

and add it to your file (for more configuration options, see the readme over at GitHub).


Embedding Google+ posts

.. gplus::

Embed Google Maps

In place mode:

.. gmaps:: Tower of London
    :mode: place

In search mode:

.. gmaps:: Mexican restaurants near Westminster Abbey
    :mode: search

Embed Directions

.. directions::
    :mode: transit
    :origin: Tower of London
    :destination: Westminster Abbey

Embed Google Map as an Image

.. static-map:: The queens larder
    :markers: color:blue label:A The+British+Museum & color:red label:B The+queens+larder
    :zoom: 15

Embed Streetview as an Image

.. streetview:: Paragon, Orchard Rd

Tags: pelican python