Merge pull request #590 from tannewt/remove_file_urls

Remove file urls
This commit is contained in:
Scott Shawcroft 2020-11-18 10:54:49 -08:00 committed by GitHub
commit ba2b1eaf8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 20239 deletions

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@
{% assign stable = board[0].versions | where: "stable", true | sort: "version" %}
{% assign unstable = board[0].versions | where: "stable", false | sort: "version" %}
{% assign releases = stable | concat: unstable %}
{% capture board_url %}https://downloads.circuitpython.org/bin/{{ page.board_id}}{% endcapture %}
{% for version in releases %}
<div class="section {% if version.stable %}stable{% else %}unstable{% endif %}">
<h3>CircuitPython {{ version.version }}</h3>
@ -23,9 +24,14 @@
<div class="download-details">
<label class="language-select">
<select>
{% for file in version.files %}
<option value="{{ file[1] | join: ',' }}" data-files={{ file[1] | join: ',' }} data-locale={{ file[0] | replace: '_', '-' }} {% if file[0] == "en_US" %}selected{% endif %}>
{% case file[0] %}
{% for language in version.languages %}
{% capture no_extension %}{{ board_url }}/{{ language }}/adafruit-circuitpython-{{ page.board_id }}-{{ language }}-{{ version.version }}{% endcapture %}
{% capture files %}{% for ext in version.extensions %}{{ no_extension }}.{{ext}}{% if forloop.last == false %},{% endif %}{% endfor %}{% endcapture %}
<option value={{ files }}
data-files={{ files }}
data-locale={{ language | replace: '_', '-' }}
{% if language == "en_US" %}selected{% endif %}>
{% case language %}
{% when 'cs' %}
CZECH
{% when 'de_DE' %}
@ -40,10 +46,16 @@
FILIPINO
{% when 'fr' %}
FRENCH
{% when 'el' %}
GREEK
{% when 'hi' %}
HINDI
{% when 'ID' %}
INDONESIAN
{% when 'it_IT' %}
ITALIAN
{% when 'ja' %}
JAPANESE
{% when 'ko' %}
KOREAN
{% when 'nl' %}
@ -64,8 +76,8 @@
</select>
</label>
<div class="download-buttons">
{% for file in version.files['en_US'] %}
<a class="download-button {% if version.stable %}stable{% else %}unstable{% endif %} {{ file | slice: -3, 3 }}" href="{{ file }}">DOWNLOAD {{ file | slice: -4, 4 | upcase }} NOW <i class="fas fa-download" aria-hidden="true"></i></a>
{% for extension in version.extensions %}
<a class="download-button {% if version.stable %}stable{% else %}unstable{% endif %} {{ extension }}" href="{{ board_url }}/en_US/adafruit-circuitpython-{{ page.board_id }}-en_US-{{ version.version }}.{{ extension }}">DOWNLOAD .{{ extension | upcase }} NOW <i class="fas fa-download" aria-hidden="true"></i></a>
{% endfor %}
</div>
</div>

View file

@ -78,7 +78,7 @@ permalink: /downloads
<div class="downloads-section">
{% comment %}
The following are boards that are in the _data/files.json build
process. Seperate loops due to wanting to sort by download count first.
process. Separate loops due to wanting to sort by download count first.
{% endcomment %}
{% assign boards = site.data.files | sort: "downloads" | reverse %}
{% for board in boards %}