-
Notifications
You must be signed in to change notification settings - Fork 0
/
_facets.json
24 lines (22 loc) · 1 KB
/
_facets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
---
{% assign users = site.data.facets.users | downcase | split:',' %}
{% assign categories = site.data.facets.categories | downcase | split:',' %}
{
"users": {
{% for user in users %}{% assign user_array = site.array %}"{{ user | slugify }}":
{% for nav in site.html_pages %}{% if nav.users %}
{% assign nav_users = nav.users | downcase %}{% if nav_users contains user %}{% assign user_array = user_array | push: nav.title %}{% endif %}
{% endif %}{% endfor %}{{ user_array | jsonify }}
{% if forloop.last == false %},{% endif %}
{% endfor %}
},
"categories": {
{% for category in categories %}{% assign cat_array = site.array %}"{{ category | slugify }}":
{% for nav in site.html_pages %}{% if nav.categories %}
{% assign nav_categories = nav.categories | downcase %}{% if nav_categories contains category %}{% assign cat_array = cat_array | push: nav.title %}{% endif %}
{% endif %}{% endfor %}{{ cat_array | jsonify }}
{% if forloop.last == false %},{% endif %}
{% endfor %}
}
}