mirror of
https://github.com/metagov/govarch-website.git
synced 2025-06-19 01:23:10 +00:00
resolves #8 add JSON feed
This commit is contained in:
32
feed.json
Normal file
32
feed.json
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
layout: null
|
||||
---
|
||||
{
|
||||
"version": "https://jsonfeed.org/version/1",
|
||||
"title": "{{ site.title | xml_escape }}",
|
||||
"home_page_url": "{{ site.baseurl | absolute_url }}",
|
||||
"feed_url": "{{ "/feed/index.json" | absolute_url }}",
|
||||
"description": {{ site.description | jsonify }},
|
||||
"icon": "{{ site.icon | absolute_url }}",
|
||||
"favicon": "{{ "/favicon.ico" | absolute_url }}",
|
||||
"expired": false,
|
||||
"items": [
|
||||
{% for post in site.posts limit: 15 %}
|
||||
{% unless post.draft %}
|
||||
{% capture content_text %}{{ post.content | strip_html }}{% endcapture %}
|
||||
{% capture content_html %}{{ post.content | markdownify }}{% endcapture %}
|
||||
{
|
||||
"id": "{{ post.url | absolute_url | sha1 }}",
|
||||
{% if post.title != "" %}"title": {{ post.title | jsonify }},{% endif %}
|
||||
"content_text": {{ content_text | jsonify }},
|
||||
"content_html": {{ content_html | jsonify }},
|
||||
"url": "{{ post.url | absolute_url}}",
|
||||
"date_published": "{{ post.date | date_to_xmlschema }}",
|
||||
"date_modified": "{{ post.date | date_to_xmlschema }}",
|
||||
"author": {
|
||||
"name": "{{ post.author }}"
|
||||
}
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user