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

@ -11,7 +11,7 @@
<meta name="description" content="{{ page.subtitle }}">
{% endif %}
<link rel="alternate" type="application/rss+xml" title="{{ site.title }} {{ site.title-separator }} {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />
<link rel="alternate" type="application/rss+xml" title="{{ site.title }} {{ site.title-separator }} {{ site.description }}" href="{{ '/feed.xml' | relative_url }}" />
{% include gtag.html %}
{% include gtm_head.html %}
@ -25,7 +25,7 @@
{% if layout.common-css %}
{% for css in layout.common-css %}
<link rel="stylesheet" href="{{ css | prepend: site.baseurl | replace: '//', '/' }}" />
<link rel="stylesheet" href="{{ css | relative_url }}" />
{% endfor %}
{% endif %}
@ -43,7 +43,7 @@
{% if page.css %}
{% for css in page.css %}
<link rel="stylesheet" href="{{ css | prepend: site.baseurl | replace: '//', '/' }}" />
<link rel="stylesheet" href="{{ css | relative_url }}" />
{% endfor %}
{% endif %}
@ -125,7 +125,7 @@
{% if page.comments and site.staticman.repository and site.staticman.branch %}
<!-- Staticman -->
<link rel="stylesheet" href="{{ "/css/staticman.css" | prepend: site.baseurl }}" />
<link rel="stylesheet" href="{{ "/css/staticman.css" | relative_url }}" />
{% endif %}
</head>