Skip to content

Commit 33fb048

Browse files
committed
Fix: in a very rare case, it might happen nightly version == testing version
In that case, we need to show the nightly version slightly different.
1 parent 3521847 commit 33fb048

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

_layouts/default.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
{% assign latest_testing = site.downloads | where_exp: "download", "download.id == '/downloads/openttd-releases/latest'" | last %}
2525
{% assign latest_nightly = site.downloads | where_exp: "download", "download.id == '/downloads/openttd-nightlies/latest'" | last %}
2626

27+
{% if latest_nightly.version == latest_stable.version or latest_nightly.version == latest_testing.version %}
28+
{% assign nightly_version = latest_nightly.version %}
29+
{% else %}
30+
{% assign nightly_version = latest_nightly.version | split: "-" | slice: 0 %}
31+
{% endif %}
32+
2733
<div id="header-left"></div>
2834
<div id="header-right"></div>
2935

@@ -36,7 +42,7 @@ <h5><a href="{{ site.baseurl }}{{ latest_stable.url }}">Download stable ({{ late
3642
{% if latest_stable.date < latest_testing.date %}
3743
<h5><a href="{{ site.baseurl }}{{ latest_testing.url }}">Download testing ({{ latest_testing.version }})</a></h5>
3844
{% endif %}
39-
<h5><a href="{{ site.baseurl }}{{ latest_nightly.url }}">Download nightly ({{ latest_nightly.version | split: "-" | slice: 0 }})</a></h5>
45+
<h5><a href="{{ site.baseurl }}{{ latest_nightly.url }}">Download nightly ({{ nightly_version }})</a></h5>
4046
</div>
4147
<div id="header-logo">
4248
<div id="openttd-logo">

0 commit comments

Comments
 (0)