2 files changed +42
-4
lines changed Original file line number Diff line number Diff line change 5
5
.. gallery:: demo
6
6
7
7
This should embed the gallery found in galleries/demo in your post.
8
- Keep in mind that this is a horrible, horrible hack.
8
+ Keep in mind that this is sort of a hack.
9
+
10
+ Caveats:
11
+
12
+ * The styling of the displayed gallery is meant to sort-of-work
13
+ with the bootstrap-based themes
14
+
15
+ * It will ** not** have the fancy rows/columns layout of the regular
16
+ gallery in bootstrap, either.
17
+
18
+ * It will look bad in most other themes. But you can customize it by
19
+ creating your own gallery_fancy.tmpl. Here's the one that comes with
20
+ the plugin for inspiration:
21
+
22
+ ``` html
23
+ ## -*- coding: utf-8 -*-
24
+
25
+ %if post:
26
+ <p >
27
+ ${post.text()}
28
+ </p >
29
+ %endif
30
+
31
+ <div id =" gallery_container" ></div >
32
+ %if photo_array:
33
+ <div class =" row" >
34
+ %for image in photo_array:
35
+ <div class =" col-xs-6 col-md-3" >
36
+ <a href =" ${image['url']}" class =" thumbnail image-reference" title =" ${image['title']|h}" >
37
+ <img src =" ${image['url_thumb']}" alt =" ${image['title']|h}" />
38
+ </a >
39
+ </div >
40
+ %endfor
41
+ </div >
42
+
43
+ <ul class =" thumbnails" >
44
+ <li >
45
+ </ul >
46
+ %endif
47
+ ```
48
+
Original file line number Diff line number Diff line change @@ -91,10 +91,8 @@ def run(self):
91
91
context .update (self .site .GLOBAL_CONTEXT )
92
92
context .update (kw )
93
93
output = self .site .template_system .render_template (
94
- 'gallery .tmpl' ,
94
+ 'gallery_fancy .tmpl' ,
95
95
None ,
96
96
context
97
97
)
98
- # This magical comment makes everything work. Try removing it!
99
- output = '\n <!-- foo -->\n %s\n \n \n ' % output
100
98
return [nodes .raw ('' , output , format = 'html' )]
0 commit comments