Add daily email export feed

This commit is contained in:
Oliver Davies 2024-05-27 20:01:10 +01:00
parent c29b0f6c43
commit d8fbf6e19f

19
source/daily.json.twig Normal file
View file

@ -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 %}
]
}