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

43 lines
No EOL
2.1 KiB
Text

{
"version": "https://jsonfeed.org/version/1.1",
"title": "{{ title | escape }}",
"home_page_url": "{{ permalink | absoluteUrl | escape }}",
"feed_url": "{{ permalink | absoluteUrl | escape }}.json",
"description": "{{ globals.site_description | escape }}",
"icon": "https://cdn.coryd.dev/{{ globals.feed_image | escape }}?class=w200&v={% appVersion %}",
"favicon": "https://cdn.coryd.dev/{{ globals.favicon_ico | escape }}?class=w50&v={% appVersion %}",
"authors": [{
"name": "{{ globals.site_name }}",
"url": "{{ globals.url | escape }}",
"avatar": "https://cdn.coryd.dev/{{ globals.avatar | escape }}?class=w200&v={% appVersion %}"
}],
"items": [
{%- assign entries = data | normalizeEntries: 20 -%}
{%- for entry in entries -%}
{%- assign summary = entry.content | strip_html | normalize_whitespace | escape -%}
{
"id": "{{ entry.url | encodeAmp | escape }}",
"title": "{{ entry.title | escape }}{% if entry.authors %} via {{ entry.authors.name | escape }}{% endif %}{% if entry.rating %} ({{ entry.rating | escape }}){% endif %}",
"url": "{{ entry.url | encodeAmp | escape }}",
"content_html": "{{ summary }}",
"summary": "{{ summary }}",
{%- if entry.author -%}
"external_url": "{{ entry.url | encodeAmp | escape }}",
"authors": [{
"name": "{{ entry.author.name | escape }}",
"url": "{{ entry.author.url | escape }}",
"mastodon": "{{ entry.author.mastodon | escape }}",
"rss": "{{ entry.author.feed | escape }}"
}],
{%- endif %}
"date_published": "{{ entry.date | date: '%Y-%m-%dT%H:%M:%S%:z' }}"{%- if entry.tags -%},
"tags": [
{%- for tag in entry.tags -%}
"{{ tag | escape }}"{%- unless forloop.last -%}, {% endunless -%}
{%- endfor -%}
]
{%- endif -%}
}{%- if forloop.last == false -%},{%- endif -%}
{%- endfor -%}
]
}