diff --git a/docs/changelog.rst b/docs/changelog.rst index 956c41e..78babe3 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,6 +8,7 @@ Changelog * Add youtube section https://prosopopee.readthedocs.org/en/latest/sections.html#youtube by beudbeud * Add quotes section https://prosopopee.readthedocs.org/en/latest/sections.html#quote by beudbeud * Add deploy and preview option https://prosopopee.readthedocs.io/en/latest/build.html#preview by beudbeud + * Load only css and jss if the section is used by beudbeud 0.4 (2016-12-11) diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 3ce83e7..03323dc 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -444,6 +444,10 @@ def build_gallery(settings, gallery_settings, gallery_path, template): Audio.base_dir = Path(".").joinpath(gallery_path) Audio.target_dir = Path(".").joinpath("build", gallery_path) + for x in gallery_settings['sections']: + if x['type'] not in gallery_settings: + gallery_settings[x['type'] + '_enabled'] = True + template_to_render = page_template if gallery_settings.get("static") else gallery_index_template html = template_to_render.render( diff --git a/prosopopee/themes/exposure/templates/gallery-index.html b/prosopopee/themes/exposure/templates/gallery-index.html index ae75a7d..521e9df 100644 --- a/prosopopee/themes/exposure/templates/gallery-index.html +++ b/prosopopee/themes/exposure/templates/gallery-index.html @@ -6,8 +6,12 @@ + {% if gallery.panorama_enabled %} + {% endif %} + {% if gallery.audio_enabled %} + {% endif %} {% if gallery.description %} @@ -38,15 +42,20 @@ + {% if gallery.panorama_enabled %} + {% endif %} + {% if gallery.audio_enabled %} + {% endif %} + {% if gallery.panorama_enabled %} + {% endif %} + {% if gallery.panorama_audio %} + {% endif %}