From 71c800864d21aac5dd2bb01db3c428a76fdd2e01 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Wed, 1 Apr 2020 09:52:14 -0700 Subject: [PATCH] Created initial RSS feed --- _layouts/rss.html | 6 +++++ feed.html | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 _layouts/rss.html create mode 100644 feed.html diff --git a/_layouts/rss.html b/_layouts/rss.html new file mode 100644 index 000000000..8066e847c --- /dev/null +++ b/_layouts/rss.html @@ -0,0 +1,6 @@ + + + + {{ content }} + + diff --git a/feed.html b/feed.html new file mode 100644 index 000000000..186025d45 --- /dev/null +++ b/feed.html @@ -0,0 +1,62 @@ +--- +layout: rss +title: RSS +permalink: /feed.rss +--- + +CircuitPython.org Boards +{{ "/" | absolute_url }} +A list of CircuitPython and Blinka supported boards +{{ "now" | date_to_rfc822 }} +{%- 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. +{%- endcomment -%} +{%- assign twelve_hours = 12 | times: 60 | times: 60 -%} +{%- assign boards = site.data.files | sort: "downloads" | reverse -%} +{%- for board in boards -%} + {%- assign info = site.board | where: 'board_id', board.id -%} + {%- if info.size == 0 %} + {%- assign info = site.board | where: 'board_id', 'unknown' -%} + {%- endif -%} + {%- assign info = info[0] -%} + {%- if info.downloads_display == false -%} + {%- continue -%} + {%- endif -%} + + {{ info.name | default: board.id }} + {{ info.url | absolute_url }} + By {{ info.manufacturer }}

{{ info.content }} ]]>
+ CircuitPython + {{ info.date_added | date: '%s' | plus: twelve_hours | date_to_rfc822 }} + {{ info.url | absolute_url }} +
+{% endfor %} + +{% comment %} + The following are boards that are not yet in the _data/files.json build + process and have no downloads. +{% endcomment %} +{% for board in site.board %} + {% assign info = site.data.files | where: 'id', board.board_id | first %} + {% if info == nil and board.board_id != 'unknown' %} + + {{ board.name }} + {{ board.url | absolute_url }} + By {{ board.manufacturer }}

{{ board.content }} ]]>
+ CircuitPython + {{ board.date_added | date: '%s' | plus: twelve_hours | date_to_rfc822 }} + {{ board.url | absolute_url }} +
+ {% endif %} +{% endfor %} +{% for board in site.blinka %} + + {{ board.name }} + {{ board.url | absolute_url }} + By {{ board.manufacturer }}

{{ board.content }} ]]>
+ Blinka + {{ board.date_added | date: '%s' | plus: twelve_hours | date_to_rfc822 }} + {{ board.url | absolute_url }} +
+{% endfor %}