Add latest version information API (#204)

master
rubenwardy 2020-07-08 18:40:55 +01:00 committed by GitHub
parent 4068c89d0b
commit 894fabd63c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 1 deletions

6
_data/release.yml Normal file
View File

@ -0,0 +1,6 @@
latest:
version: "5.2.0"
version_code: 5002000
date: "2020-04-05"
protocol_version: 39
url: "https://www.minetest.net/downloads/"

View File

@ -0,0 +1,9 @@
{{ include.date | date: "%B" }}
{% assign day = include.date | date: "%-d" %}
{% case day %}
{% when '1' or '21' or '31' %}{{ day }}<sup>st</sup>
{% when '2' or '22' %}{{ day }}<sup>nd</sup>
{% when '3' or '23' %}{{ day }}<sup>rd</sup>
{% else %}{{ day }}<sup>th</sup>
{% endcase %}
{{ include.date | date: "%Y" }}

View File

@ -24,7 +24,11 @@ redirect_from:
<a class="button is-primary is-size-5" href="{{ '/downloads/' | relative_url }}">Download</a>
</div>
<p class="is-size-6">
<span class="has-text-weight-bold">News:</span> 5.2.0 released. (April 5<sup>th</sup> 2020)
<span class="has-text-weight-bold">News:</span>
{% assign latest_version = site.data.release.latest %}
{{ latest_version.version }} released.
({% include format_date.html date=latest_version.date %})
</p>
</div>
</div>

4
release_info.json Normal file
View File

@ -0,0 +1,4 @@
---
# Make Jekyll process this file
---
{{ site.data.release | jsonify }}