Skip to content

Commit

Permalink
Use relative_url on everything
Browse files Browse the repository at this point in the history
  • Loading branch information
axmmisaka committed Jul 27, 2023
1 parent 23661cf commit da6190b
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 56 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<a class="not-found-link" href="javascript:history.back()">
{% fa_svg fas.fa-arrow-left %} 返回上一页
</a>
<a class="not-found-link" href="/">
<a class="not-found-link" href="{ '/' | relative_url }">
镜像列表 {% fa_svg fas.fa-arrow-right %}
</a>
</div>
Expand Down
14 changes: 12 additions & 2 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ <h4>Contact Us</h4>
<h4>Sponsor</h4>
<div class="img-responsive thuhidden">
{% for sponsor in site.sponsor %}
<img src="/static/img/{{ site.sponsors[sponsor].logo }}.png" srcset="/static/img/{{ site.sponsors[sponsor].logo }}.png 1x, /static/img/{{ site.sponsors[sponsor].logo }}@2x.png 2x, /static/img/{{ site.sponsors[sponsor].logo }}@3x.png 3x, /static/img/{{ site.sponsors[sponsor].logo }}@4x.png 4x" alt="{{ site.sponsors[sponsor].short }}" />
<img src="{{ '/static/img/' | append: site.sponsors[sponsor].logo | append: '.png' | relative_url }}" srcset="
{{ '/static/img/' | append: site.sponsors[sponsor].logo | append: '.png' | relative_url }} 1x,
{{ '/static/img/' | append: site.sponsors[sponsor].logo | append: '@2x.png' | relative_url }} 2x,
{{ '/static/img/' | append: site.sponsors[sponsor].logo | append: '@3x.png' | relative_url }} 3x,
{{ '/static/img/' | append: site.sponsors[sponsor].logo | append: '@4x.png' | relative_url }} 4x"
alt="{{ site.sponsors[sponsor].short }}" />
{% endfor %}
</div>
{% assign first_sponsor = site.sponsors[site.sponsor.first] %}
Expand All @@ -51,7 +56,12 @@ <h4>Sponsor</h4>
{% endif %}
</div>
<div class="col-lg-4 col-md-4{% if page.legacy %} col-xs-4{% endif %}">
<img class="img-responsive thuhidden center-block" style="margin-top:5%" src="/static/img/logo-white.png" srcset="/static/img/logo-white.png 1x, /static/img/[email protected] 2x, /static/img/[email protected] 3x, /static/img/[email protected] 4x" />
<img class="img-responsive thuhidden center-block" style="margin-top:5%"
src="{{ '/static/img/logo-white.png' | relative_url }}" srcset="
{{ '/static/img/logo-white.png' | relative_url }} 1x,
{{ '/static/img/[email protected]' | relative_url }} 2x,
{{ '/static/img/[email protected]' | relative_url }} 3x,
{{ '/static/img/[email protected]' | relative_url }} 4x" />
</div>
</div><!--/row -->
</div><!--/container -->
Expand Down
24 changes: 12 additions & 12 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="description" content="{{ page_desc }}">
<meta name="keywords" content="镜像站,镜像源,Linux,软件源,开源">
<meta name="author" content="{{ site.author }}">
<link rel="shortcut icon" href="/static/img/favicon.png">
<link rel="shortcut icon" href="{{ '/static/img/favicon.png' | relative_url}}">

<!-- Open Graph metadata -->
<meta property="og:title" content="{{ page_title }}" />
Expand All @@ -29,19 +29,19 @@

<title>{{ page_title }}</title>
{% unless include.nostyle %}
<link rel="stylesheet" href="/static/css/bootstrap.min.css?{{ site.data['hash'] }}">
<link rel="stylesheet" href="/static/css/bootstrap-select.min.css?{{ site.data['hash'] }}">
<link rel="stylesheet" href="/static/css/style.css?{{ site.data['hash'] }}">
<script src="/static/js/jquery.min.js?{{ site.data['hash'] }}"></script>
<script src="/static/js/bootstrap.min.js?{{ site.data['hash'] }}"></script>
<script src="/static/js/bootstrap-select.min.js?{{ site.data['hash'] }}"></script>
<link rel="stylesheet" href="{{ 'static/css/bootstrap.min.css?' | append: site.data['hash'] | relative_url }}">
<link rel="stylesheet" href="{{ 'static/css/bootstrap-select.min.css?' | append: site.data['hash'] | relative_url }}">
<link rel="stylesheet" href="{{ 'static/css/style.css?' | append: site.data['hash'] | relative_url }}">
<script src="{{ 'static/js/jquery.min.js?' | append: site.data['hash'] | relative_url }}"></script>
<script src="{{ 'static/js/bootstrap.min.js?' | append: site.data['hash'] | relative_url }}"></script>
<script src="{{ 'static/js/bootstrap-select.min.js?' | append: site.data['hash'] | relative_url }}"></script>
{% unless page.legacy %}
<script src="/static/js/vue.min.js?{{ site.data['hash'] }}"></script>
<script src="/static/js/timeago.min.js?{{ site.data['hash'] }}"></script>
<script src="{{ 'static/js/vue.min.js?' | append: site.data['hash'] | relative_url }}"></script>
<script src="{{ 'static/js/timeago.min.js?' | append: site.data['hash'] | relative_url }}"></script>
{% endunless %}
<script src="/static/js/markup.min.js?{{ site.data['hash'] }}"></script>
<script src="/static/js/webfont.js?{{ site.data['hash'] }}"></script>
<script src="/static/js/thuhidden.js?{{ site.data['hash'] }}"></script>
<script src="{{ 'static/js/markup.min.js?' | append: site.data['hash'] | relative_url }}"></script>
<script src="{{ 'static/js/webfont.js?' | append: site.data['hash'] | relative_url }}"></script>
<script src="{{ 'static/js/thuhidden.js?' | append: site.data['hash'] | relative_url }}"></script>
{% if page.legacy %}
<style>
.container {
Expand Down
8 changes: 4 additions & 4 deletions _includes/legacy_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<p>Bonjour! </p>
<p>宜しくお願い致します。</p>
<p>&nbsp;</p>
<p>我们检测到您当前的浏览器不能正常显示我们的主页,请更新您的浏览器,并启用 Javascript,或者访问我们的<a href="/legacy_index">代用页面</a></p>
<p>Your browser is not compatible with our website. Please upgrade and enable Javascript, or visit our <a href="/legacy_index">alternative page</a>.</p>
<p>Votre navigateur n'est pas compatible avec notre site web. Mettez à niveau et activez Javascript, ou visitez notre <a href="/legacy_index">page alternative</a>.</p>
<p>お使いのブラウザは当サイトとの互換性はありません。ブラウザを更新しJavaScriptを有効にするか、或いはこちらの<a href="/legacy_index">代用ページ</a>をご利用ください。</p>
<p>我们检测到您当前的浏览器不能正常显示我们的主页,请更新您的浏览器,并启用 Javascript,或者访问我们的<a href="{{ '/legacy_index' | relative_url}}">代用页面</a></p>
<p>Your browser is not compatible with our website. Please upgrade and enable Javascript, or visit our <a href="{{ '/legacy_index' | relative_url}}">alternative page</a>.</p>
<p>Votre navigateur n'est pas compatible avec notre site web. Mettez à niveau et activez Javascript, ou visitez notre <a href="{{ '/legacy_index' | relative_url}}">page alternative</a>.</p>
<p>お使いのブラウザは当サイトとの互換性はありません。ブラウザを更新しJavaScriptを有効にするか、或いはこちらの<a href="{{ '/legacy_index' | relative_url}}">代用ページ</a>をご利用ください。</p>
</div>
</div>
{% endraw %}
20 changes: 10 additions & 10 deletions _includes/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<span class="icon-bar"></span>
</button>
{% endunless %}
<a class="navbar-brand" href="/">
<a class="navbar-brand" href="{{ '/' | relative_url}}">
<span class="thuhidden">
{% if site.logo %}
<picture>
Expand All @@ -18,21 +18,21 @@
{% else %}
<source
{% endif %}
srcset="/static/img/logo-small-dark.png 1x,
/static/img/[email protected] 2x,
/static/img/[email protected] 3x,
/static/img/[email protected] 4x"
srcset="{{ '/static/img/logo-small-dark.png'}} 1x,
{{ '/static/img/[email protected]' | relative_url}} 2x,
{{ '/static/img/[email protected]' | relative_url}} 3x,
{{ '/static/img/[email protected]' | relative_url}} 4x"
{% if site.issue %}
alt=""/>
{% else %}
media="(prefers-color-scheme: dark)"/>
{% endif %}
{% unless site.issue %}
<img src="/static/img/logo-small.png"
srcset="/static/img/logo-small.png 1x,
/static/img/[email protected] 2x,
/static/img/[email protected] 3x,
/static/img/[email protected] 4x"
<img src="{{ '/static/img/logo-small.png' | relative_url}}"
srcset="{{ '/static/img/logo-small.png' | relative_url}} 1x,
{{ '/static/img/[email protected]' | relative_url}} 2x,
{{ '/static/img/[email protected]' | relative_url}} 3x,
{{ '/static/img/[email protected]' | relative_url}}4x"
alt=""/>
{% endunless %}
</picture>
Expand Down
19 changes: 10 additions & 9 deletions _includes/status-pic.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<div class="col-md-6 col-xs-12">
<picture class="thumbnail">

<source
srcset="/static/status/{{include.name}}-day-dark.png 1x,
/static/status/{{include.name}}[email protected] 2x,
/static/status/{{include.name}}[email protected] 3x,
/static/status/{{include.name}}[email protected] 4x"
srcset="{{ '/static/status/' | append: include.name | append: '-day-dark.png' | relative_url }} 1x,
{{ '/static/status/' | append: include.name | append: '[email protected]' | relative_url }} 2x,
{{ '/static/status/' | append: include.name | append: '[email protected]' | relative_url }} 3x,
{{ '/static/status/' | append: include.name | append: '[email protected]' | relative_url }} 4x"
media="(prefers-color-scheme: dark)" />
<img class="img-responsive" src="/static/status/{{include.name}}-day.png"
srcset="/static/status/{{include.name}}-day.png 1x,
/static/status/{{include.name}}[email protected] 2x,
/static/status/{{include.name}}[email protected] 3x,
/static/status/{{include.name}}[email protected] 4x"
<img class="img-responsive" src="{{ '/static/status/' | append: include.name | append: '-day.png' | relative_url }}"
srcset="{{ '/static/status/' | append: include.name | append: '-day.png' | relative_url }} 1x,
{{ '/static/status/' | append: include.name | append: '[email protected]' | relative_url }} 2x,
{{ '/static/status/' | append: include.name | append: '[email protected]' | relative_url }} 3x,
{{ '/static/status/' | append: include.name | append: '[email protected]' | relative_url }} 4x"
/>
</picture>
</div>
4 changes: 2 additions & 2 deletions _layouts/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
{% include footer.html %}
</body>

<script src="/static/js/highlight.min.js?{{ site.data['hash'] }}"></script>
<script src="/static/js/help.js?{{ site.data['hash'] }}"></script>
<script src="{{ 'static/js/highlight.min.js?' | append: site.data['hash'] | relative_url }}"></script>
<script src="{{ 'static/js/help.js?' | append: site.data['hash'] | relative_url }}"></script>

</html>
<!--
Expand Down
18 changes: 9 additions & 9 deletions _layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<h1>{{ site.school }}开源软件镜像站</h1>
<h3>暂时无法提供服务</h3>
<div class="pull-right">
<img src="/static/img/candle.jpg"
srcset="/static/img/candle.jpg 1x,
/static/img/[email protected] 2x"
<img src="{{ '/static/img/candle.jpg' | relative_url }}"
srcset="{{ '/static/img/candle.jpg' | relative_url }} 1x,
{{ '/static/img/[email protected]' | relative_url }} 2x"
/>
</div>
<div class="clearfix"></div>
Expand Down Expand Up @@ -107,10 +107,10 @@ <h3 id="mirror-title">{% fa_svg fas.fa-cube %} 镜像列表 </h3>
<h4>{% fa_svg fas.fa-bullhorn %} 新闻公告 </h4>
<ul>
{% for news in site.categories.news limit: 3%}
<li><a href="/news/#{{news.slug}}"><strong>{{news.date | date: "%Y-%m-%d"}}</strong> {{news.title}}</a></li>
<li><a href="{{ '/news/#' | append: news.slug | relative_url }}"><strong>{{news.date | date: "%Y-%m-%d"}}</strong> {{news.title}}</a></li>
{% endfor %}
</ul>
<div class="text-right"><a href="/news/"> more {% fa_svg fas.fa-angles-right %} </a></div>
<div class="text-right"><a href="{{ '/news/' | relative_url }}"> more {% fa_svg fas.fa-angles-right %} </a></div>
</div>
<div class="thuhidden {%if site.issue%}col-md-4{%endif%}">
<h4> {% fa_svg fas.fa-link %} 域名选择 </h4>
Expand Down Expand Up @@ -144,10 +144,10 @@ <h4> {% fa_svg far.fa-envelope %} 联系我们 </h4>
<div {%if site.issue%}class="col-md-2"{%endif%}>
<h4> {% fa_svg fas.fa-arrow-up-right-from-square %} 相关链接 </h4>
<ul>
<li><a href="/help/">使用帮助</a></li>
<li><a href="{{ '/help/' | relative_url }}">使用帮助</a></li>
{% unless site.issue %}
<li><a href="/status/#server-status">服务器状态</a></li>
<li><a href="/status/#syncing-status">同步状态</a></li>
<li><a href="{{ '/status/#server-status' | relative_url }}">服务器状态</a></li>
<li><a href="{{ '/status/#syncing-status' | relative_url }}">同步状态</a></li>
{% endunless %}
<li class="thuhidden"><a href="https://tuna.moe/">清华大学 TUNA 协会</a></li>
<li><a href="https://github.com/tuna/tunasync">镜像管理器源码</a></li>
Expand Down Expand Up @@ -215,7 +215,7 @@ <h3>{{selected.distro}}</h3>
{% raw %}
{% endraw %}
{% unless page.legacy or site.issue %}
<script src="/static/js/index.js?{{ site.data['hash'] }}"></script>
<script src="{{ 'static/js/index.js?' | append: site.data['hash'] | relative_url }}"></script>
{% endunless %}
</html>
<!--
Expand Down
2 changes: 1 addition & 1 deletion fancy-index/after.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</body>
{% raw %}
{% endraw %}
<script src="/static/js/index.js?{{ site.data['hash'] }}"></script>
<script src="{{ 'static/js/index.js?' | append: site.data['hash'] | relative_url }}"></script>
{% raw %}
<script>
document.getElementById("list").setAttribute("class", "table");
Expand Down
6 changes: 3 additions & 3 deletions static/js/index.es6
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var new_mirrors = {};
global_options.options.new_mirrors.forEach((m) => new_mirrors[m] = true);
var unlisted = global_options.options.unlisted_mirrors;
var options = {};
global_options.options.force_redirect_help_mirrors.forEach((m) => options[m] = {'url': "/help/" + m + "/"})
global_options.options.force_redirect_help_mirrors.forEach((m) => options[m] = {'url': "{{ '/help/' | relative_url}}" + m + "/"})
var descriptions = {};
global_options.options.mirror_desc.forEach((m) => descriptions[m.name] = m.desc);

Expand Down Expand Up @@ -65,7 +65,7 @@ var vmMirList = new Vue({
},
refreshMirrorList () {
var self = this;
$.getJSON("/static/tunasync.json", (status_data) => {
$.getJSON("{{ '/static/tunasync.json' | relative_url}}", (status_data) => {
var unlisted_mir = unlisted.map(d => processMirrorItem(d))
status_data = status_data.map(d => processMirrorItem(d));
var mir_data = $.merge(unlisted_mir, status_data);
Expand Down Expand Up @@ -173,7 +173,7 @@ var vmIso = new Vue({
},
created: function () {
var self = this;
$.getJSON("/static/status/isoinfo.json", function (isoinfo) {
$.getJSON("{{ '/static/status/isoinfo.json' | relative_url}}", function (isoinfo) {
self.distroList = isoinfo;
self.selected = self.curDistroList[0];
if (window.location.hash.match(/#iso-download(\?.*)?/)) {
Expand Down
2 changes: 1 addition & 1 deletion static/js/status.es6
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $(document).ready(() => {
diskUsages: []
},
created () {
$.get("/static/status/disk.json", (d) => {
$.get("{{ '/static/status/disk.json' | relative_url }}", (d) => {
if(!Array.isArray(d)){
d = [d];
}
Expand Down
4 changes: 2 additions & 2 deletions status.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ <h3 id="syncing-status"># 同步状态</h3>
{% endunless %}
</div><!--/status -->
{% include footer.html %}
<script src="/static/js/status.js?{{ site.data['hash'] }}"></script>
<script src="/static/js/index.js?{{ site.data['hash'] }}"></script>
<script src="{{ 'static/js/status.js?' | append: site.data['hash'] | relative_url }}"></script>
<script src="{{ 'static/js/index.js?' | append: site.data['hash'] | relative_url }}"></script>
</body>
</html>
<!--
Expand Down

0 comments on commit da6190b

Please sign in to comment.