fix: assets URL is missing baseurl in self-hosted mode (#591)

This commit is contained in:
bibi2233 2022-06-02 20:55:34 +08:00 committed by GitHub
parent 76a1b6a068
commit 54124d5134
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 13 deletions

View file

@ -68,7 +68,7 @@
<link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}> <link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
{% endfor %} {% endfor %}
<link rel="stylesheet" href="{{ site.data.assets[origin].webfonts }}"> <link rel="stylesheet" href="{{ site.data.assets[origin].webfonts | relative_url }}">
{% endif %} {% endif %}
@ -90,25 +90,25 @@
{% endif %} {% endif %}
<!-- Bootstrap --> <!-- Bootstrap -->
<link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap.css }}"> <link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap.css | relative_url}}">
<!-- Font Awesome --> <!-- Font Awesome -->
<link rel="stylesheet" href="{{ site.data.assets[origin].fontawesome.css }}"> <link rel="stylesheet" href="{{ site.data.assets[origin].fontawesome.css | relative_url }}">
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}"> <link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}">
{% if site.toc and page.toc %} {% if site.toc and page.toc %}
<link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap-toc.css }}"> <link rel="stylesheet" href="{{ site.data.assets[origin].bootstrap-toc.css | relative_url }}">
{% endif %} {% endif %}
{% if page.layout == 'page' or page.layout == 'post' %} {% if page.layout == 'page' or page.layout == 'post' %}
<!-- Manific Popup --> <!-- Manific Popup -->
<link rel="stylesheet" href="{{ site.data.assets[origin].magnific-popup.css }}"> <link rel="stylesheet" href="{{ site.data.assets[origin].magnific-popup.css | relative_url }}">
{% endif %} {% endif %}
<!-- JavaScript --> <!-- JavaScript -->
<script src="{{ site.data.assets[origin].jquery.js }}"></script> <script src="{{ site.data.assets[origin].jquery.js | relative_url }}"></script>
{% unless site.theme_mode %} {% unless site.theme_mode %}
{% include mode-toggle.html %} {% include mode-toggle.html %}

View file

@ -7,7 +7,7 @@
{% if page.layout == 'post' %} {% if page.layout == 'post' %}
{% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %} {% if site.google_analytics.pv.proxy_endpoint or site.google_analytics.pv.cache_path %}
<!-- pv-report needs countup.js --> <!-- pv-report needs countup.js -->
<script async src="{{ site.data.assets[origin].countup.js }}"></script> <script async src="{{ site.data.assets[origin].countup.js | relative_url }}"></script>
<script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script> <script defer src="{{ '/assets/js/dist/pvreport.min.js' | relative_url }}"></script>
{% endif %} {% endif %}
{% endif %} {% endif %}
@ -79,14 +79,14 @@
} }
}; };
</script> </script>
<script src="{{ site.data.assets[origin].polyfill.js }}"></script> <script src="{{ site.data.assets[origin].polyfill.js | relative_url }}"></script>
<script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js }}"> <script id="MathJax-script" async src="{{ site.data.assets[origin].mathjax.js | relative_url }}">
</script> </script>
{% endif %} {% endif %}
<!-- commons --> <!-- commons -->
<script src="{{ site.data.assets[origin].bootstrap.js }}"></script> <script src="{{ site.data.assets[origin].bootstrap.js | relative_url }}"></script>
{% if jekyll.environment == 'production' %} {% if jekyll.environment == 'production' %}
<!-- PWA --> <!-- PWA -->

View file

@ -2,7 +2,7 @@
mermaid-js loader mermaid-js loader
--> -->
<script src="{{ site.data.assets[origin].mermaid.js }}"></script> <script src="{{ site.data.assets[origin].mermaid.js | relative_url }}"></script>
<script> <script>
$(function() { $(function() {

View file

@ -16,7 +16,7 @@
{% capture not_found %}<p class="mt-5">{{ site.data.locales[lang].search.no_results }}</p>{% endcapture %} {% capture not_found %}<p class="mt-5">{{ site.data.locales[lang].search.no_results }}</p>{% endcapture %}
<script src="{{ site.data.assets[origin].search.js }}"></script> <script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
<script> <script>
SimpleJekyllSearch({ SimpleJekyllSearch({

View file

@ -7,7 +7,7 @@
{% if enable_toc %} {% if enable_toc %}
<!-- BS-toc.js will be loaded at medium priority --> <!-- BS-toc.js will be loaded at medium priority -->
<script src="{{ site.data.assets[origin].bootstrap-toc.js }}"></script> <script src="{{ site.data.assets[origin].bootstrap-toc.js | relative_url }}"></script>
<div id="toc-wrapper" class="pl-0 pr-4 mb-5"> <div id="toc-wrapper" class="pl-0 pr-4 mb-5">
<div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[lang].panel.toc -}}</div> <div class="panel-heading pl-3 pt-2 mb-2">{{- site.data.locales[lang].panel.toc -}}</div>