Merge pull request #1300 from makermelissa/board-url-refactor

Fix board API output
This commit is contained in:
Dan Halbert 2023-12-08 22:41:18 -05:00 committed by GitHub
commit d3945b17cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 3 deletions

View file

@ -4,7 +4,7 @@ board_id: "warmbit_bluepixel"
title: "Warmbit BluePixel Download"
name: "Warmbit BluePixel"
manufacturer: "Warmbit"
board_url: ""
board_url:
board_image: "unknown.jpg"
date_added: 2021-9-3
family: nrf52840

View file

@ -3,5 +3,25 @@ layout: null
permalink: /api/boards.json
excerpt: CircuitPython supported boards.
---
{{ site.board | jsonify }}
[{% for board in site.board %}
{
"board_id": "{{ board.board_id }}",
"title": {{ board.title | jsonify }},
"name": {{ board.name | jsonify }},
"board_url": [{% for url in board.board_url %}
"{{ url }}"{% unless forloop.last %},{% endunless %}{% endfor %}
],
"board_image": "{{ board.board_image }}",
"date_added": "{{ board.date_added }}",
"family": "{{ board.family }}",
"bootloader_id": "{{ board.bootloader_id }}",
"tags": [{% for tag in board.tags %}
"{{ tag }}"{% unless forloop.last %},{% endunless %}{% endfor %}
],
"features": [{% for feature in board.features %}
"{{ feature }}"{% unless forloop.last %},{% endunless %}{% endfor %}
],
"url_path": "{{ board.url }}",
"description": {{ board.content | strip_newlines | jsonify}}
}{% unless forloop.last %},{% endunless %}{% endfor %}
]