From d8fbf6e19fa80a844ba237a2d2f9ff89d4a1ee0a Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 27 May 2024 20:01:10 +0100 Subject: [PATCH] Add daily email export feed --- source/daily.json.twig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 source/daily.json.twig diff --git a/source/daily.json.twig b/source/daily.json.twig new file mode 100644 index 00000000..3ec9f202 --- /dev/null +++ b/source/daily.json.twig @@ -0,0 +1,19 @@ +--- +permalink: /daily.json +use: [daily_emails] +--- + +{ + "emails": [ + {% for email in data.daily_emails %} + { + "title": "{{ email.title|trim }}", + "date": "{{ email.date }}", + "permalink": "{{ email.permalink.relativeUrlPath }}", + "text": {{ email.blocks.content|replace({ '\n': '' })|json_encode|raw }}, + "cta": "{{ email.cta }}", + "tags": [{% for tag in email.tags %}"{{ tag }}"{% if not loop.last %},{% endif %}{% endfor %}] + }{% if not loop.last %},{% endif %} + {% endfor %} + ] +}