make sure not to include jquery twice, fixes #29

This commit is contained in:
Dean Attali 2016-01-21 19:13:47 -08:00
parent 3ae5f561ac
commit 6657f6aa80

View File

@ -4,12 +4,6 @@
{% endfor %}
{% endif %}
{% if page.common-js %}
{% for js in page.common-js %}
<script src="{{ js | prepend: site.baseurl | replace: '//', '/' }}"></script>
{% endfor %}
{% endif %}
{% if page.ext-js %}
{% for js in page.ext-js %}
<script src="{{ js }}"></script>
@ -22,4 +16,19 @@
{% endfor %}
{% endif %}
{% include google_analytics.html %}
{% if page.common-js %}
{% for js in page.common-js %}
<!-- doing something a bit funky here because I want to be careful not to include JQuery twice! -->
{% if js contains 'jquery' %}
<script>
if (typeof jQuery == 'undefined') {
document.write('<script src="{{ js | prepend: site.baseurl | replace: "//", "/" }}"></scr' + 'ipt>');
}
</script>
{% else %}
<script src="{{ js | prepend: site.baseurl | replace: '//', '/' }}"></script>
{% endif %}
{% endfor %}
{% endif %}
{% include google_analytics.html %}