-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfeed.json
More file actions
40 lines (40 loc) · 1.96 KB
/
feed.json
File metadata and controls
40 lines (40 loc) · 1.96 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
---
layout:
---
{
"version": "https://jsonfeed.org/version/1.1",
"title": "{{ site.title | xml_escape }}",
"description": "{{ site.description | xml_escape | strip }}",
"home_page_url": "{{ site.url }}{{ site.baseurl }}/",
"feed_url": "{{ site.url }}{{ site.baseurl }}/feed.json",
"language": "en",
"authors": [
{
"name": "Charles Tapley Hoyt",
"url": "https://orcid.org/0000-0003-4423-4370",
"_orcid": "0000-0003-4423-4370"
}
],
"items": [{% for post in site.posts limit:10 %}
{
{% if post.doi %}
{% assign page_url = post.doi | prepend: "https://doi.org/" %}
{% else %}
{% assign page_url = post.url | prepend: site.baseurl | prepend: site.url %}
{% endif %}"id": "{{ page_url }}",
"url": "{{ post.url | prepend: site.baseurl | prepend: site.url }}",
"title": "{{ post.title | xml_escape }}",
"content_html": {{ post.content | strip | jsonify }},
"summary": "{{ post.excerpt | strip_html | normalize_whitespace }}",
{%- if post.image %}"image": "{{ post.image | prepend: site.baseurl | prepend: site.url }}",{% endif %}
"date_published": "{{ post.date | date_to_xmlschema }}",
"date_modified": "{%- if post.modified_date -%}{{ post.modified_date | date_to_xmlschema }}{%- else -%}{{ post.date | date_to_xmlschema }}{%- endif -%}",
{%- assign output_tags = "" -%}{%- assign has_tags = false -%}
{% for tag in post.tags %}{% assign check = tag | split:':' %}{% if check.size == 1 %}{% capture output_tags %}{{ output_tags | append: tag | append: '|' }}{% endcapture %}{% assign has_tags = true %}{% endif %}{% endfor %}
{% if has_tags %}"tags": {{ output_tags | split: '|' | jsonify }},{% endif %}
"authors": [{% for author in post.authors %}
{ "name": "{{ author.name }}", "url": "https://orcid.org/{{ author.orcid }}" }{% unless forloop.last %},{% endunless %}
{% endfor %}]
}{% unless forloop.last %},{% endunless %}{% endfor %}
]
}