You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the elegant documentation, it says photo galleries can only be added at the end of the article and that there is need for further development (link).
It seems like in the meanwhile, the photos plugin supports inline galleries. According to the documentation, there must be a file "inline_gallery.html" available, which provides a template for a gallery. Subsequently, the user can just write gallery::{photo}example_gallery to create an inline gallery (see the examples of the photos plugin)
When I had a first try, it seemed quite easy to implement this in elegant: Just move the following lines of code from article.html to its own template file inline_gallery.html. Be aware that there are some small modifications.
Article.html, to be deleted:
{% if article.photo_gallery %}
<div class="gallery">
{% for title, gallery in article.photo_gallery %}
<h1>{{ title }}</h1>
{% for name, photo, thumb, exif, caption in gallery %}
<a href="{{ SITEURL }}/{{ photo }}" title="{{ name }}" exif="{{ exif }}" caption="{{ caption }}"><img
src="{{ SITEURL }}/{{ thumb }}"></a>
{% endfor %}
{% endfor %}
</div>
{% endif %}
New file Inline_gallery.html:
<div class="gallery">
{% for title, gallery in galleries %}
<h1>{{ title }}</h1>
{% for name, photo, thumb, exif, caption in gallery %}
<a href="{{ SITEURL }}/{{ photo }}" title="{{ name }}" exif="{{ exif }}" caption="{{ caption }}"><img src="{{ SITEURL }}/{{ thumb }}"></a>
{% endfor %}
{% endfor %}
</div>
Additionally, you might need the following in you pelicanconf.py:
In the elegant documentation, it says photo galleries can only be added at the end of the article and that there is need for further development (link).
It seems like in the meanwhile, the photos plugin supports inline galleries. According to the documentation, there must be a file "inline_gallery.html" available, which provides a template for a gallery. Subsequently, the user can just write
gallery::{photo}example_gallery
to create an inline gallery (see the examples of the photos plugin)When I had a first try, it seemed quite easy to implement this in elegant: Just move the following lines of code from
article.html
to its own template fileinline_gallery.html
. Be aware that there are some small modifications.Article.html, to be deleted:
New file Inline_gallery.html:
Additionally, you might need the following in you pelicanconf.py:
Would it make sense to adapt the elegant theme in a similar way? What do you think?
The text was updated successfully, but these errors were encountered: