Skip to content

Commit

Permalink
BaguetteBox is pretty smart about how to create images in the gallery.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Alsina committed Mar 20, 2018
1 parent 9dad955 commit 3f70110
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 20 deletions.
7 changes: 2 additions & 5 deletions nikola/data/themes/base-jinja/templates/base.tmpl
Expand Up @@ -22,14 +22,11 @@
{{ base.late_load_js() }}
{% block extra_js %}{% endblock %}
<script>
baguetteBox.run('a.reference:not(.islink)', {
baguetteBox.run('div#content', {
ignoreClass: 'islink',
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
{{ body_end }}
{{ template_hooks['body_end']() }}
Expand Down
7 changes: 7 additions & 0 deletions nikola/data/themes/base-jinja/templates/comments_helper.tmpl
Expand Up @@ -6,6 +6,7 @@
{% import 'comments_helper_muut.tmpl' as muut with context %}
{% import 'comments_helper_facebook.tmpl' as facebook with context %}
{% import 'comments_helper_isso.tmpl' as isso with context %}
{% import 'comments_helper_commento.tmpl' as commento with context %}

{% macro comment_form(url, title, identifier) %}
{% if comment_system == 'disqus' %}
Expand All @@ -20,6 +21,8 @@
{{ facebook.comment_form(url, title, identifier) }}
{% elif comment_system == 'isso' %}
{{ isso.comment_form(url, title, identifier) }}
{% elif comment_system == 'commento' %}
{{ commento.comment_form(url, title, identifier) }}
{% endif %}
{% endmacro %}

Expand All @@ -36,6 +39,8 @@
{{ facebook.comment_link(link, identifier) }}
{% elif comment_system == 'isso' %}
{{ isso.comment_link(link, identifier) }}
{% elif comment_system == 'commento' %}
{{ commento.comment_link(link, identifier) }}
{% endif %}
{% endmacro %}

Expand All @@ -52,5 +57,7 @@
{{ facebook.comment_link_script() }}
{% elif comment_system == 'isso' %}
{{ isso.comment_link_script() }}
{% elif comment_system == 'commento' %}
{{ commento.comment_link_script() }}
{% endif %}
{% endmacro %}
7 changes: 2 additions & 5 deletions nikola/data/themes/base/templates/base.tmpl
Expand Up @@ -22,14 +22,11 @@ ${template_hooks['extra_head']()}
${base.late_load_js()}
<%block name="extra_js"></%block>
<script>
baguetteBox.run('a.reference:not(.islink)', {
baguetteBox.run('div#content', {
ignoreClass: 'islink',
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
${body_end}
${template_hooks['body_end']()}
Expand Down
7 changes: 2 additions & 5 deletions nikola/data/themes/bootstrap3-jinja/templates/base.tmpl
Expand Up @@ -83,14 +83,11 @@
<!-- end fancy dates -->
{% block extra_js %}{% endblock %}
<script>
baguetteBox.run('a.reference:not(.islink)', {
baguetteBox.run('div#content', {
ignoreClass: 'islink',
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
{{ body_end }}
{{ template_hooks['body_end']() }}
Expand Down
7 changes: 2 additions & 5 deletions nikola/data/themes/bootstrap3/templates/base.tmpl
Expand Up @@ -83,14 +83,11 @@ ${base.late_load_js()}
<!-- end fancy dates -->
<%block name="extra_js"></%block>
<script>
baguetteBox.run('a.reference:not(.islink)', {
baguetteBox.run('div#content', {
ignoreClass: 'islink',
captions: function(element) {
return element.getElementsByTagName('img')[0].alt;
}});
baguetteBox.run('img:not(.islink)', {
captions: function(element) {
return element.alt;
}});
</script>
${body_end}
${template_hooks['body_end']()}
Expand Down

0 comments on commit 3f70110

Please sign in to comment.