only load css and js if section is used
This commit is contained in:
parent
8e17843c99
commit
a73e5730e3
@ -8,6 +8,7 @@ Changelog
|
|||||||
* Add youtube section https://prosopopee.readthedocs.org/en/latest/sections.html#youtube by beudbeud
|
* 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 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
|
* 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)
|
0.4 (2016-12-11)
|
||||||
|
|
||||||
|
@ -444,6 +444,10 @@ def build_gallery(settings, gallery_settings, gallery_path, template):
|
|||||||
Audio.base_dir = Path(".").joinpath(gallery_path)
|
Audio.base_dir = Path(".").joinpath(gallery_path)
|
||||||
Audio.target_dir = Path(".").joinpath("build", 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
|
template_to_render = page_template if gallery_settings.get("static") else gallery_index_template
|
||||||
|
|
||||||
html = template_to_render.render(
|
html = template_to_render.render(
|
||||||
|
@ -6,8 +6,12 @@
|
|||||||
<link type="text/css" rel="stylesheet" href="../static/css/fonts.css" media="screen,projection"/>
|
<link type="text/css" rel="stylesheet" href="../static/css/fonts.css" media="screen,projection"/>
|
||||||
<link type="text/css" rel="stylesheet" href="../static/css/style-page.css" media="screen,projection"/>
|
<link type="text/css" rel="stylesheet" href="../static/css/style-page.css" media="screen,projection"/>
|
||||||
<link type="text/css" rel="stylesheet" href="../static/css/baguetteBox.min.css" media="screen,projection"/>
|
<link type="text/css" rel="stylesheet" href="../static/css/baguetteBox.min.css" media="screen,projection"/>
|
||||||
|
{% if gallery.panorama_enabled %}
|
||||||
<link type="text/css" rel="stylesheet" href="../static/css/panorama_viewer.css" media="screen,projection"/>
|
<link type="text/css" rel="stylesheet" href="../static/css/panorama_viewer.css" media="screen,projection"/>
|
||||||
|
{% endif %}
|
||||||
|
{% if gallery.audio_enabled %}
|
||||||
<link type="text/css" rel="stylesheet" href="../static/css/mediaelementplayer.css" media="screen,projection"/>
|
<link type="text/css" rel="stylesheet" href="../static/css/mediaelementplayer.css" media="screen,projection"/>
|
||||||
|
{% endif %}
|
||||||
<!--Let browser know website is optimized for mobile-->
|
<!--Let browser know website is optimized for mobile-->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
{% if gallery.description %}
|
{% if gallery.description %}
|
||||||
@ -38,15 +42,20 @@
|
|||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="../static/js/jquery-2.1.4.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/jquery-2.1.4.min.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="../static/js/baguetteBox.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/baguetteBox.min.js" charset="utf-8"></script>
|
||||||
|
{% if gallery.panorama_enabled %}
|
||||||
<script type="text/javascript" src="../static/js/jquery.panorama_viewer.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/jquery.panorama_viewer.min.js" charset="utf-8"></script>
|
||||||
|
{% endif %}
|
||||||
<script type="text/javascript" src="../static/js/jquery.lazyload.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/jquery.lazyload.min.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="../static/js/picturefill.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/picturefill.min.js" charset="utf-8"></script>
|
||||||
|
{% if gallery.audio_enabled %}
|
||||||
<script type="text/javascript" src="../static/js/mediaelement-and-player.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/mediaelement-and-player.min.js" charset="utf-8"></script>
|
||||||
|
{% endif %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
baguetteBox.run(".baguette", {});
|
baguetteBox.run(".baguette", {});
|
||||||
|
|
||||||
|
{% if gallery.panorama_enabled %}
|
||||||
$(".panorama").panorama_viewer({
|
$(".panorama").panorama_viewer({
|
||||||
repeat: true,
|
repeat: true,
|
||||||
direction: "horizontal",
|
direction: "horizontal",
|
||||||
@ -54,8 +63,10 @@ $(function() {
|
|||||||
easing: "linear",
|
easing: "linear",
|
||||||
overlay: true
|
overlay: true
|
||||||
});
|
});
|
||||||
|
{% endif %}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
{% if gallery.audio_enabled %}
|
||||||
$('audio').mediaelementplayer({
|
$('audio').mediaelementplayer({
|
||||||
alwaysShowControls: true,
|
alwaysShowControls: true,
|
||||||
features: ['playpause','progress','volume'],
|
features: ['playpause','progress','volume'],
|
||||||
@ -66,6 +77,7 @@ $('audio').mediaelementplayer({
|
|||||||
iPhoneUseNativeControls: true,
|
iPhoneUseNativeControls: true,
|
||||||
AndroidUseNativeControls: true
|
AndroidUseNativeControls: true
|
||||||
});
|
});
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
var video = $("video");
|
var video = $("video");
|
||||||
video.on('click', function(e){
|
video.on('click', function(e){
|
||||||
|
@ -6,8 +6,12 @@
|
|||||||
<link rel="stylesheet" href="../static/css/materialize.css"/>
|
<link rel="stylesheet" href="../static/css/materialize.css"/>
|
||||||
<link rel="stylesheet" href="../static/css/style-page.css">
|
<link rel="stylesheet" href="../static/css/style-page.css">
|
||||||
<link type="text/css" rel="stylesheet" href="../static/css/baguetteBox.min.css" media="screen,projection"/>
|
<link type="text/css" rel="stylesheet" href="../static/css/baguetteBox.min.css" media="screen,projection"/>
|
||||||
|
{% if gallery.panorama_enabled %}
|
||||||
<link type="text/css" rel="stylesheet" href="../static/css/panorama_viewer.css" media="screen,projection"/>
|
<link type="text/css" rel="stylesheet" href="../static/css/panorama_viewer.css" media="screen,projection"/>
|
||||||
|
{% endif %}
|
||||||
|
{% if gallery.panorama_audio %}
|
||||||
<link type="text/css" rel="stylesheet" href="../static/css/mediaelementplayer.css" media="screen,projection"/>
|
<link type="text/css" rel="stylesheet" href="../static/css/mediaelementplayer.css" media="screen,projection"/>
|
||||||
|
{% endif %}
|
||||||
<link rel="stylesheet" href="../static/css/font-awesome.css">
|
<link rel="stylesheet" href="../static/css/font-awesome.css">
|
||||||
|
|
||||||
<!--Let browser know website is optimized for mobile-->
|
<!--Let browser know website is optimized for mobile-->
|
||||||
@ -46,9 +50,13 @@
|
|||||||
<script type="text/javascript" src="../static/js/jquery-2.1.4.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/jquery-2.1.4.min.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="../static/js/materialize.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/materialize.min.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="../static/js/baguetteBox.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/baguetteBox.min.js" charset="utf-8"></script>
|
||||||
|
{% if gallery.panorama_enabled %}
|
||||||
<script type="text/javascript" src="../static/js/jquery.panorama_viewer.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/jquery.panorama_viewer.min.js" charset="utf-8"></script>
|
||||||
|
{% endif %}
|
||||||
<script type="text/javascript" src="../static/js/jquery.lazyload.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/jquery.lazyload.min.js" charset="utf-8"></script>
|
||||||
|
{% if gallery.panorama_audio %}
|
||||||
<script type="text/javascript" src="../static/js/mediaelement-and-player.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="../static/js/mediaelement-and-player.min.js" charset="utf-8"></script>
|
||||||
|
{% endif %}
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('.parallax').parallax();
|
$('.parallax').parallax();
|
||||||
@ -67,6 +75,7 @@ video.on('click', function(e){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
{% if gallery.panorama_audio %}
|
||||||
$('audio').mediaelementplayer({
|
$('audio').mediaelementplayer({
|
||||||
alwaysShowControls: true,
|
alwaysShowControls: true,
|
||||||
features: ['playpause','progress','volume'],
|
features: ['playpause','progress','volume'],
|
||||||
@ -77,6 +86,7 @@ $('audio').mediaelementplayer({
|
|||||||
iPhoneUseNativeControls: true,
|
iPhoneUseNativeControls: true,
|
||||||
AndroidUseNativeControls: true
|
AndroidUseNativeControls: true
|
||||||
});
|
});
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
@ -92,6 +102,7 @@ $(function() {
|
|||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
baguetteBox.run(".baguette", {});
|
baguetteBox.run(".baguette", {});
|
||||||
|
{% if gallery.panorama_enabled %}
|
||||||
$(".panorama").panorama_viewer({
|
$(".panorama").panorama_viewer({
|
||||||
repeat: true,
|
repeat: true,
|
||||||
direction: "horizontal",
|
direction: "horizontal",
|
||||||
@ -99,6 +110,7 @@ $(function() {
|
|||||||
easing: "linear",
|
easing: "linear",
|
||||||
overlay: true
|
overlay: true
|
||||||
});
|
});
|
||||||
|
{% endif %}
|
||||||
});
|
});
|
||||||
|
|
||||||
{% if settings.settings.light_mode %}
|
{% if settings.settings.light_mode %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user