From c9834d49544eb39ff28d2cb4cd2aba2794d9f5ae Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 8 Dec 2023 15:53:52 -0800 Subject: [PATCH] Update api to output valid json instead of jsonified html --- api/boards.json | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/api/boards.json b/api/boards.json index 54445481..149f61ab 100644 --- a/api/boards.json +++ b/api/boards.json @@ -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 %} +] \ No newline at end of file