-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: downloads pages, and links from header/index to them
When the docker is build, information is downloaded (via HTTP) from finger.openttd.org and binaries.openttd.org to figure out what the available downloads are, and those are added to the collection. Jekyll after that makes this into static files. Yes, this does mean we have to rebuild this container every time we make a new release. But those events are rare.
- Loading branch information
Showing
28 changed files
with
527 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git/** | ||
_downloads/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
inline-quotes = double |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
_site | ||
.sass-cache | ||
.jekyll-metadata | ||
_downloads/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/catcodec | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/grfcodec-trunk | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/grfcodec | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/nosound | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/opengfx | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/openmsx | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/opensfx | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
folder: nightlies/trunk | ||
--- | ||
|
||
For OpenTTD you can use the original Transport Tycoon Deluxe data files (you need to own a Transport Tycoon Deluxe CD). | ||
There are also the free alternatives: [OpenGFX (graphics)](http://dev.openttdcoop.org/projects/opengfx), [OpenSFX (sound)](http://dev.openttdcoop.org/projects/opensfx), and [OpenMSX (music)](http://dev.openttdcoop.org/projects/openmsx). | ||
These can be installed automatically by the Windows and OS/2 installers. | ||
Please refer to the [readme](https://binaries.openttd.org/nightlies/trunk/@@version@@/readme.txt) for more information. | ||
|
||
You can download the free alternatives here: [download OpenGFX](../opengfx-releases/), [download OpenSFX](../opensfx-releases/), and [download OpenMSX](../openmsx-releases/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
folder: releases | ||
--- | ||
|
||
For OpenTTD you can use the original Transport Tycoon Deluxe data files (you need to own a Transport Tycoon Deluxe CD). | ||
There are also the free alternatives: [OpenGFX (graphics)](http://dev.openttdcoop.org/projects/opengfx), [OpenSFX (sound)](http://dev.openttdcoop.org/projects/opensfx), and [OpenMSX (music)](http://dev.openttdcoop.org/projects/openmsx). | ||
These can be installed automatically by the Windows and OS/2 installers. | ||
Please refer to the [readme](https://binaries.openttd.org/releases/@@version@@/readme.txt) for more information. | ||
|
||
You can download the free alternatives here: [download OpenGFX](../opengfx-releases/), [download OpenSFX](../opensfx-releases/), and [download OpenMSX](../openmsx-releases/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/openttd-useful | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/osie | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/pngcodec | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
folder: extra/strgen | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
layout: default | ||
section_title: Download | ||
css: | ||
- download.css | ||
js: | ||
- download.js | ||
--- | ||
|
||
{% assign raw_type = page.id | split: "/" | slice: 2 | first %} | ||
{% assign type = raw_type | prepend: "/download-meta/" %} | ||
{% assign meta = site.download-meta | where: "id", type | first %} | ||
{% assign version = page.id | split: "/" | last %} | ||
|
||
{% unless meta.id %} | ||
{{ "No download-meta entry found for " | append: raw_type | raise_error }} | ||
{% endunless %} | ||
|
||
<div id="section-full"> | ||
<div class="section-header"> | ||
<div class="section-icon"></div> | ||
<h3>Download</h3> | ||
</div> | ||
<div class="section-item"> | ||
<div class="content"> | ||
{{ meta.content | markdownify | replace: "@@version@@", version }} | ||
<p>For all binaries officially released by us we publish the MD5, SHA1, and SHA256 checksums. You can use these checksums to check whether the file you downloaded has been modified. All three checksums should match the file you downloaded; if this is not the case it means that either the file didn't come from us or that it got broken during transport. Either way it might possibly contain dangerous modifications and the file should therefore not be trusted!</p> | ||
</div> | ||
</div> | ||
<div class="section-header"> | ||
<div class="section-icon"></div> | ||
<h3>Download {{ page.name }}</h3> | ||
</div> | ||
<div class="section-item"> | ||
<div class="content"> | ||
<p>Latest release in {{ page.name }} is {{ version }}, released on {{ page.date | date: "%Y-%m-%d %H:%M" }} UTC.</p> | ||
|
||
<div class="changelog">[ <a href="https://binaries.openttd.org/{{ meta.folder }}/{{ version }}/changelog.txt">Changelog</a> ]</div> | ||
<div id="download-combo"> | ||
<input type="hidden" id="download-combo-state" value="" /> | ||
<input type="hidden" id="download-base-name" value="{{ page.base }}" /> | ||
</div> | ||
|
||
<ul id="download-data"> | ||
{% for file in page.files %} | ||
<li id="{{ file.id }}"> | ||
<div class="filename"><a href="https://binaries.openttd.org/{{ meta.folder }}/{{ version }}/{{ file.id }}">{{ file.name }}</a></div> | ||
<div class="filesize">[ {{ file.size | string_of_size }} ]</div> | ||
<div class="checksums-dropdown" onclick="toggleChecksum(this, 'checksum-{{ file.id }}')">[ <a href="#" onclick="return false;">Checksums</a> ]</div> | ||
<div class="checksums" id="checksum-{{ file.id }}"> | ||
md5sum : {{ file.md5sum }}<br /> | ||
sha1sum : {{ file.sha1sum }}<br /> | ||
sha256sum: {{ file.sha256sum }}<br /> | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
|
||
<script type="text/javascript">updateCombo(document.getElementById("download-data"));</script> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module Jekyll | ||
module OpenTTDFilters | ||
|
||
# Code taken from (and slightly modified) | ||
# https://github.com/jekyll-octopod/jekyll-octopod/blob/master/lib/jekyll/octopod_filters.rb | ||
# jekyll-octopod is licensed under MIT. | ||
def string_of_size(bytes) | ||
bytes = bytes.to_i.to_f | ||
out = '0' | ||
return out if bytes == 0.0 | ||
|
||
jedec = %w[b K M G] | ||
[3, 2, 1, 0].each { |i| | ||
if bytes > 1024 ** i | ||
out = "%.1f #{jedec[i]}iB" % (bytes / 1024 ** i) | ||
break | ||
end | ||
} | ||
|
||
return out | ||
end | ||
|
||
# Code taken from | ||
# http://talk.jekyllrb.com/t/how-to-properly-indicate-an-error-during-site-generation/447 | ||
# Unlicensed; appears to be free to use. | ||
def raise_error(msg) | ||
bad_file = @context.registers[:page]['path'] | ||
err_msg = "On #{bad_file}: #{msg}" | ||
raise err_msg | ||
end | ||
end | ||
end | ||
|
||
Liquid::Template.register_filter(Jekyll::OpenTTDFilters) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.