Skip to content

Commit 8accf81

Browse files
committed
Simplified loops to make editing easier
1 parent 71c8008 commit 8accf81

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

feed.html

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,11 @@
88
<link>{{ "/" | absolute_url }}</link>
99
<description>A list of CircuitPython and Blinka supported boards</description>
1010
<lastBuildDate>{{ "now" | date_to_rfc822 }}</lastBuildDate>
11-
{%- comment -%}
12-
The following are boards that are in the _data/files.json build
13-
process. Seperate loops due to wanting to sort by download count first.
14-
{%- endcomment -%}
15-
{%- assign twelve_hours = 12 | times: 60 | times: 60 -%}
16-
{%- assign boards = site.data.files | sort: "downloads" | reverse -%}
17-
{%- for board in boards -%}
18-
{%- assign info = site.board | where: 'board_id', board.id -%}
19-
{%- if info.size == 0 %}
20-
{%- assign info = site.board | where: 'board_id', 'unknown' -%}
21-
{%- endif -%}
22-
{%- assign info = info[0] -%}
23-
{%- if info.downloads_display == false -%}
11+
{% for board in site.board %}
12+
{%- if board.downloads_display == false -%}
2413
{%- continue -%}
2514
{%- endif -%}
26-
<item>
27-
<title>{{ info.name | default: board.id }}</title>
28-
<link>{{ info.url | absolute_url }}</link>
29-
<description><![CDATA[ <p>By {{ info.manufacturer }}</p> {{ info.content }} ]]></description>
30-
<category>CircuitPython</category>
31-
<pubDate>{{ info.date_added | date: '%s' | plus: twelve_hours | date_to_rfc822 }}</pubDate>
32-
<guid>{{ info.url | absolute_url }}</guid>
33-
</item>
34-
{% endfor %}
35-
36-
{% comment %}
37-
The following are boards that are not yet in the _data/files.json build
38-
process and have no downloads.
39-
{% endcomment %}
40-
{% for board in site.board %}
41-
{% assign info = site.data.files | where: 'id', board.board_id | first %}
42-
{% if info == nil and board.board_id != 'unknown' %}
15+
{%- if board.board_id != 'unknown' -%}
4316
<item>
4417
<title>{{ board.name }}</title>
4518
<link>{{ board.url | absolute_url }}</link>
@@ -48,7 +21,7 @@
4821
<pubDate>{{ board.date_added | date: '%s' | plus: twelve_hours | date_to_rfc822 }}</pubDate>
4922
<guid>{{ board.url | absolute_url }}</guid>
5023
</item>
51-
{% endif %}
24+
{%- endif -%}
5225
{% endfor %}
5326
{% for board in site.blinka %}
5427
<item>

0 commit comments

Comments
 (0)