From 51b4d140b7292a3a37160ed58abb376da51ca6cf Mon Sep 17 00:00:00 2001 From: Renan Guilherme Date: Sat, 29 Jan 2022 10:47:58 -0400 Subject: [PATCH] Update custom theme templates, document default The documentation referenced an "index.html" template which appears to be no longer used. Update the documentation so that it talks about the correct templates, album.html and album_list.html. Also, add documentation about the default theme, talking about what it contains and what it doesn't. --- docs/themes.rst | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/themes.rst b/docs/themes.rst index 9d049b6..cf5109b 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -2,8 +2,7 @@ Themes ======== -Gallery pages are created from a `Jinja2`_ template ``index.html`` that must -be located in ``THEME_DIR/templates``. +Sigal themes are created using the `Jinja2`_ templating system. .. _Jinja2: http://jinja.pocoo.org/docs/ @@ -30,6 +29,27 @@ Sigal comes with three themes, located in the ``sigal/themes`` folder: `source `__, `demo `__. +The ``themes`` folder also includes a ``default`` theme. This theme cannot be +used on its own, instead, it contains Jinja2 templates that are used by the +bundled themes to enable functionality such as the feeds and ZIP gallery +plugins, as well as settings such as Google Analytics. + +Creating a theme +~~~~~~~~~~~~~~~~ + +Sigal requires the following two templates in order to generate a gallery. +These templates must be located in ``THEME_DIR/templates``: + +- ``album_list.html``: Generates the album list, if you have multiple albums +- ``album.html``: Generates each individual album page + +Themes may also include static content such as CSS and JavaScript by placing +this content in the ``THEME_DIR/static`` folder. You can then access this +content in your template by using the ``theme.url`` variable. + +Custom themes may also include the templates available in the ``default`` +theme. + Variables ~~~~~~~~~