Skip to content
Browse files
Make the gallery directive less of a hack
  • Loading branch information
Roberto Alsina committed May 4, 2017
1 parent 531429a commit f4cec0de7df83f1b607ea44e8246bbf398d13806
Showing 2 changed files with 42 additions and 4 deletions.
@@ -5,4 +5,44 @@ Usage::
.. gallery:: demo

This should embed the gallery found in galleries/demo in your post.
Keep in mind that this is a horrible, horrible hack.
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_fancy.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">

@@ -91,10 +91,8 @@ def run(self):
output =
# This magical comment makes everything work. Try removing it!
output = '\n<!-- foo -->\n%s\n\n\n' % output
return [nodes.raw('', output, format='html')]

0 comments on commit f4cec0d

Please sign in to comment.