This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/src/includes/partials/feeds/json.liquid
2024-10-15 17:50:16 -07:00

25 lines
No EOL
959 B
Text

{
"version": "https://jsonfeed.org/version/1",
"title": "{{ title }}",
"home_page_url": "{{ globals.url }}",
"feed_url": "{{ globals.url }}{{ permalink }}",
"description": "{{ globals.site_description }}",
"icon": "{{ globals.cdn_url }}{{ globals.avatar }}?class=w200",
"author": {
"name": "{{ globals.site_name }}",
"url": "{{ globals.url }}",
"avatar": "{{ globals.cdn_url }}{{ globals.avatar }}?class=w200"
},
"items": [
{%- assign entries = data -%}
{%- for entry in entries limit: 20 -%}
{
"id": "{{ entry.feed.url | encodeAmp }}",
"url": "{{ entry.feed.url | encodeAmp }}",
"title": "{{ entry.feed.title | escape }}",
"content_text": "{{ entry.feed.description | markdown | strip_html | escape| normalize_whitespace | rstrip | htmlTruncate }}",
"date_published": "{{ entry.feed.date | stringToRFC3339 }}"
}{%- if forloop.last == false -%},{%- endif -%}
{%- endfor -%}
]
}