Fix showing background img with non-empty baseurl (#497)

* Fix showing background img with non-empty baseurl

Also switch globally to relative_url for all baseurl prepends,
which is more robust than custom URL mangling

* More site.baseurl -> relative_url conversion
This commit is contained in:
Abel Cheung 2019-06-08 13:34:33 +08:00 committed by Dean Attali
parent a666a9db52
commit 7b43e4061d
12 changed files with 28 additions and 28 deletions

View file

@ -12,7 +12,7 @@
{% if page.js %}
{% for js in page.js %}
<script src="{{ js | prepend: site.baseurl | replace: '//', '/' }}"></script>
<script src="{{ js | relative_url }}"></script>
{% endfor %}
{% endif %}
@ -22,11 +22,11 @@
{% if js contains 'jquery' %}
<script>
if (typeof jQuery == 'undefined') {
document.write('<script src="{{ js | prepend: site.baseurl | replace: "//", "/" }}"></scr' + 'ipt>');
document.write('<script src="{{ js | relative_url }}"></scr' + 'ipt>');
}
</script>
{% else %}
<script src="{{ js | prepend: site.baseurl | replace: '//', '/' }}"></script>
<script src="{{ js | relative_url }}"></script>
{% endif %}
{% endfor %}
{% endif %}