Skip to content

Commit

Permalink
backport islink support to base theme, re-jinjify
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Alsina committed Dec 26, 2017
1 parent 2f4e64c commit 493a1b8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
10 changes: 8 additions & 2 deletions nikola/data/themes/base-jinja/templates/base.tmpl
Expand Up @@ -26,10 +26,16 @@
<script src="/assets/js/baguetteBox.min.js"></script>
{% endif %}
{% block extra_js %}{% endblock %}
<script>baguetteBox.run('a.reference', {
<script>
baguetteBox.run('a.reference:not(.islink)', {
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});</script>
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
{{ body_end }}
{{ template_hooks['body_end']() }}
</body>
Expand Down
10 changes: 8 additions & 2 deletions nikola/data/themes/base/templates/base.tmpl
Expand Up @@ -26,10 +26,16 @@ ${template_hooks['extra_head']()}
<script src="/assets/js/baguetteBox.min.js"></script>
% endif
<%block name="extra_js"></%block>
<script>baguetteBox.run('a.reference', {
<script>
baguetteBox.run('a.reference:not(.islink)', {
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});</script>
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
${body_end}
${template_hooks['body_end']()}
</body>
Expand Down
10 changes: 8 additions & 2 deletions nikola/data/themes/bootstrap3-jinja/templates/base.tmpl
Expand Up @@ -87,10 +87,16 @@
</script>
<!-- end fancy dates -->
{% block extra_js %}{% endblock %}
<script>baguetteBox.run('a.reference', {
<script>
baguetteBox.run('a.reference:not(.islink)', {
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});</script>
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
{{ body_end }}
{{ template_hooks['body_end']() }}
</body>
Expand Down
6 changes: 4 additions & 2 deletions nikola/data/themes/bootstrap3-jinja/templates/gallery.tmpl
Expand Up @@ -96,6 +96,8 @@ $("#gallery_container").flowr({
}
}
});
$('a.image-reference[href="'+window.location.hash.substring(1,1000)+'"]').click();
</script>
baguetteBox.run('#gallery_container', {
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});</script>
{% endblock %}

0 comments on commit 493a1b8

Please sign in to comment.