-
Notifications
You must be signed in to change notification settings - Fork 12.8k
/
feed.json.liquid
65 lines (64 loc) · 2.42 KB
/
feed.json.liquid
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
permalink: feed.json
---
{% assign collections = site.explore_collections %}
{% assign topics = site.topics %}
{
"version": "https://jsonfeed.org/version/1",
"title": {{ site.title | smartify | jsonify }},
"expired": false,
"collections": [
{% for collection in collections %}
{%- assign collection_name_words = collection.id | split: "/" -%}
{%- assign collection_name = collection_name_words[2] -%}
{
"items": [
{% for item in collection.items %}
"{{ item }}"{% unless forloop.last == true %},{% endunless %}
{% endfor %}
],
"created_by": {{ collection.created_by | jsonify }},
"name": {{ collection_name | jsonify }},
"display_name": {{ collection.display_name | jsonify }},
"image": {% if collection.image == null %}
null,
{% else %}
"{{ site.url }}{{ collection.id | remove_first: "/index" }}/{{ collection.image }}",
{% endif %}
"content": {{ collection.content | jsonify }}
}{% unless forloop.last == true %},{% endunless %}
{% endfor %}
],
"topics": [
{% for topic in topics %}
{% assign related = topic.related | split: ', ' %}
{% assign aliases = topic.aliases | split: ', ' %}
{
"topic_name": {{ topic.topic | jsonify }},
"created_by": {{ topic.created_by | jsonify }},
"display_name": {{ topic.display_name | jsonify }},
"github_url": {{ topic.github_url | jsonify }},
"logo": {% if topic.logo == null %}
null,
{% else %}
"{{ site.url }}{{ topic.id | remove_first: "/index" }}/{{ topic.logo }}",
{% endif %}
"released": {{ topic.released | jsonify }},
"short_description": {{ topic.short_description | jsonify }},
"url": "{{ site.url | replace: "explore-feed.github.", "github." }}{{ topic.url | remove_first: "/index.html" }}",
"wikipedia_url": {{ topic.wikipedia_url | jsonify }},
"related": [
{% for related_topic in related %}
"{{ related_topic }}"{% unless forloop.last == true %},{% endunless %}
{% endfor %}
],
"aliases": [
{% for alias in aliases %}
"{{ alias }}"{% unless forloop.last == true %},{% endunless %}
{% endfor %}
],
"content": {{ topic.content | jsonify }}
}{% unless forloop.last == true %},{% endunless %}
{% endfor %}
]
}