Skip to content

Commit 98461d3

Browse files
committed
Move downloads (both internal and external) to a centralized database.
1 parent d047d76 commit 98461d3

File tree

8 files changed

+62
-35
lines changed

8 files changed

+62
-35
lines changed

_data/files.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
stable_installer:
2+
url: http://openrails.org/files/OpenRails-1.3.1-Setup.exe
3+
date: 2018-12-08
4+
bytes: 45757016
5+
testing_manual:
6+
url: http://openrails.org/files/OpenRails-Testing-Manual.pdf
7+
date: 2020-05-01
8+
bytes: 24434898
9+
doc_german_keyboards:
10+
url: /assets/files/Keyboard_Layout_DE_V1.3.1e.pdf
11+
date: 2013-07-31
12+
bytes: 452861
13+
doc_signaling:
14+
url: /assets/files/signalling_operational.pdf
15+
date: 2013-03-21
16+
bytes: 80656
17+
doc_trackviewer:
18+
url: /assets/files/ORTS_Trackviewer_manual.pdf
19+
date: 2014-07-19
20+
bytes: 840438
21+
doc_steam:
22+
url: /assets/files/OR_Steam Model_03_02_2014.pdf
23+
date: 2014-03-02
24+
bytes: 313800
25+
doc_curves:
26+
url: /assets/files/superelevation_v1.pdf
27+
date: 2014-06-03
28+
bytes: 126282

_data/manuals.yaml

-18
This file was deleted.

_includes/file_meta.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{ site.data.files[include.file]["date"] | date: "%d %B %Y" }},
2+
{% assign size = site.data.files[include.file]["bytes"] %}
3+
{%- if size >= 1073741824 -%}
4+
{{ size | divided_by: 1073741824.0 | round: 1 }}GB
5+
{%- elsif size >= 1048576 -%}
6+
{{ size | divided_by: 1048576.0 | round }}MB
7+
{%- elsif size >= 1024 -%}
8+
{{ size | divided_by: 1024.0 | round }}KB
9+
{%- else -%}
10+
{{ size }}B
11+
{%- endif -%}

_includes/file_url.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ site.data.files[include.file]["url"]}}

_layouts/homepage.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
</div>
3131

32-
{%- include program/preamble.html modal="modal1" title="Download Open Rails" download_file=page.download_stable -%}
32+
{%- include program/preamble.html modal="modal1" title="Download Open Rails" file="download_stable" -%}
3333

3434
<!-- Modal -->
3535
<style>
-23.3 MB
Binary file not shown.

index.html

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
layout: homepage
33
title: Open Rails - Free train simulator project
4-
download_stable: OpenRails-1.3.1-Setup.exe
5-
download_date: 08 December 2018
6-
download_size: 44MB
74
---
85

96
<div class="row">
@@ -21,8 +18,8 @@
2118
<!-- Button to trigger modal -->
2219
<a href="#modal1" role="button" class='btn download_button' data-toggle="modal">
2320
<span class='glyphicon glyphicon-download'></span>&nbsp; Download the installer
24-
({{ page.download_date }}, {{ page.download_size }})
25-
</a>
21+
({% include file_meta.html file="stable_installer" %})
22+
</a>
2623
</div>
2724
</div>
2825
</div>

learn/manual-and-tutorials/index.html

+19-11
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
layout: default
33
section: Learn
44
title: Manual and Tutorials
5-
manual_path: /assets/files/OpenRails-Testing-Manual.pdf
6-
manual_date: 2020-05-01
75
---
86

97
<div class="row">
108
<div class="col-md-1">&nbsp;</div>
119
<div class="col-md-4">
1210
<h2>Manual</h2>
1311
<p>
14-
Each download includes a copy of the Operating Manual. For convenience, you can also directly <a href='{{ page.manual_path }}'>download the manual</a> ({{ page.manual_date | date: "%d %B %Y" }}).
12+
Each download includes a copy of the Operating Manual. For convenience, you can also directly <a href='{% include file_url.html file="testing_manual" %}'>download the manual</a> ({% include file_meta.html file="testing_manual" %}).
1513
</p>
1614
<h2>Test Environment for Models</h2>
1715
<p>
@@ -42,16 +40,26 @@ <h2>Tutorials</h2>
4240
</p>
4341
<h3>Some other support materials are available:</h3>
4442
<ul>
45-
{% for manual in site.data.manuals %}
4643
<li>
47-
<a href="{{ manual.path }}">{{ manual.name }}</a>
48-
{% if manual.description %}
49-
-
50-
{{ manual.description }}
51-
{% endif %}
52-
({{ manual.date | date: "%d %B %Y" }})
44+
A <a href="{% include file_url.html file="doc_german_keyboards" %}">guide for German keyboards</a>
45+
({% include file_meta.html file="doc_german_keyboards" %})
46+
</li>
47+
<li>
48+
<a href="{% include file_url.html file="doc_signaling" %}">Signaling - Operational Changes</a> which describes signaling in Open Rails
49+
({% include file_meta.html file="doc_signaling" %})
50+
</li>
51+
<li>
52+
<a href="{% include file_url.html file="doc_trackviewer" %}">Open Rails Trackviewer</a> which maps the track and roads
53+
({% include file_meta.html file="doc_trackviewer" %})
54+
</li>
55+
<li>
56+
<a href="{% include file_url.html file="doc_steam" %}">Steam Model</a> describing the physics in Open Rails
57+
({% include file_meta.html file="doc_steam" %})
58+
</li>
59+
<li>
60+
<a href="{% include file_url.html file="doc_curves" %}">Speed Limits on Curves</a>
61+
({% include file_meta.html file="doc_curves" %})
5362
</li>
54-
{% endfor %}
5563
</ul>
5664
</div>
5765
</div>

0 commit comments

Comments
 (0)