Gallery pages are created from a Jinja2 template index.html that must be located in THEME_DIR/templates.
Sigal comes with two themes, based on the colorbox and galleria Javascript libraries, and located in the sigal/themes folder. A Makefile is available to concatenate and minify the css files, using cssmin (pip install cssmin).
You can use the following variables in your template:
Gather all informations on an album.
Attributes:
Variables: |
|
---|
For details how to annotate your albums with meta data, see Album information.
List of (url, title) tuples defining the current breadcrumb path.
Create output directories for thumbnails and original images.
Path to the thumbnail of the album.
URL of the album, relative to its parent.
Make a ZIP archive with all media files and return its path.
If the zip_gallery setting is set,it contains the location of a zip archive with all original images of the corresponding directory.
Base Class for media files.
Attributes:
type: "image" or "video".
filename: Filename of the resized image.
thumbnail: Location of the corresponding thumbnail image.
big: If not None, location of the unmodified image.
information, see Simpler EXIF data output.
raw_exif: If not None, it contains the raw EXIF tags.
Path to the original image, if keep_orig is set (relative to the album directory). Copy the file if needed.
Path to the thumbnail image (relative to the album directory).
Because the tags in the media.raw_exif dictionary are a little bit cumbersome to use, some common tags are extracted and formatted for easy use in templates. If available, you can use:
The time the image was taken. It is a datetime object, that can be formatted with strftime:
{% if media.exif.datetime %}
{{ media.exif.datetime.strftime('%A, %d. %B %Y') }}
{% endif %}
This will output something like “Monday, 25. June 2013”, depending on your locale.
If not None, the dict contains two keys lat and lon denoting the GPS coordinates of the location where the image was taken. lat will always be referenced to the north pole whereas lon will be referenced to east to the prime meridan. To provide a link on an OpenStreetMap you could write a template like this:
{% if media.exif.gps %}
<a href="http://openstreetmap.org/index.html?lat={{
media.exif.gps.lat }}&lon={{ media.exif.long}}">Go to location</a>
{% endif %}