From c38c9ad7b22adbaaf81021be4ec1d98ae72a913c Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 6 May 2020 01:56:01 +0100 Subject: [PATCH] Add tags to posts --- source/posts.json.twig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/posts.json.twig b/source/posts.json.twig index 1d820144..66de3c8a 100644 --- a/source/posts.json.twig +++ b/source/posts.json.twig @@ -13,7 +13,12 @@ use: [posts] "updated": "{{ post.date }}", "path": "{{ post.url|trim('/', 'right') }}", "content": {{ post.blocks.content|json_encode|raw }}, - "status": "{{ post.draft ? '0' : '1' }}" + "status": "{{ post.draft ? '0' : '1' }}", + "tags": [ + {% for tag in post.tags %} + "{{ tag }}"{% if not loop.last %},{% endif %} + {% endfor %} + ] }{% if not loop.last %},{% endif %} {% endfor %} ]