Add notes.json feed

This commit is contained in:
Oliver Davies 2024-09-04 09:00:00 +01:00
parent a3b96368ea
commit 5c46267ecf
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,4 @@
---
imports:
- sculpin_site.yml
- sculpin_site.yml
url: https://zet.oliverdavies.uk

16
source/notes.json.twig Normal file
View file

@ -0,0 +1,16 @@
---
permalink: /notes.json
use: [notes]
---
[
{% for note in data.notes|sort((a,b) => b.date <=> a.date) %}
{
"id": {{ note.filename|replace({".md": ""}) }},
"date": {{ note.date }},
"title": "{{ note.title }}",
"url": "{{ site.url }}/{{ note.url|trim("/") }}"
}
{%~ if not loop.last %},{% endif %}
{% endfor %}
]