A directive to embed an image gallery in a reSt document

To install, run nikola plugin -i gallery_directive

Experimental plugin to embed Nikola galleries in reStructuredText.


.. gallery:: demo

This should embed the gallery found in galleries/demo in your post. Keep in mind that this is sort of a hack.


  • The styling of the displayed gallery is meant to sort-of-work with the bootstrap-based themes

  • It will not have the fancy rows/columns layout of the regular gallery in bootstrap, either.

  • It will look bad in most other themes. But you can customize it by creating your own gallery_directive.tmpl. Here's the one that comes with the plugin for inspiration:

## -*- coding: utf-8 -*-

%if post:

<div id="gallery_container"></div>
%if photo_array:
<div class="row">
  %for image in photo_array:
    <div class="col-xs-6 col-md-3">
        <a href="${image['url']}" class="thumbnail image-reference" title="${image['title']|h}">
            <img src="${image['url_thumb']}" alt="${image['title']|h}" />

<ul class="thumbnails">

Issues? Questions?

You can report issues with this plugin and request help via GitHub Issues.