-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsonfeed.njk
More file actions
41 lines (41 loc) · 1.22 KB
/
jsonfeed.njk
File metadata and controls
41 lines (41 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---json
{
"permalink": "feed.json",
"eleventyExcludeFromCollections": true,
"metadata": {
"title": "@okmanideep",
"subtitle": "Android · Web · Design",
"language": "en",
"url": "https://okmanideep.me/",
"author": {
"name": "Manideep Polireddi",
"url": "https://twitter.com/okmanideep"
}
}
}
---
{
"version": "https://jsonfeed.org/version/1.1",
"title": "{{ metadata.title }}",
"language": "{{ metadata.language }}",
"home_page_url": "{{ metadata.url }}",
"feed_url": "{{ permalink | absoluteUrl(metadata.url) }}",
"description": "{{ metadata.subtitle }}",
"author": {
"name": "{{ metadata.author.name }}",
"url": "{{ metadata.author.url }}"
},
"items": [
{%- for post in collections.all | reverse %}
{%- set absolutePostUrl = post.url | absoluteUrl(metadata.url) %}
{
"id": "{{ absolutePostUrl }}",
"url": "{{ absolutePostUrl }}",
"title": "{{ post.data.title }}",
"content_html": {% if post.templateContent %}{{ post.templateContent | htmlToAbsoluteUrls(absolutePostUrl) | dump | safe }}{% else %}""{% endif %},
"date_published": "{{ post.date | dateToRfc3339 }}"
}
{% if not loop.last %},{% endif %}
{%- endfor %}
]
}