Initial commit

This commit is contained in:
Nasir Anthony Montalvo
2025-11-13 14:48:58 -06:00
committed by GitHub
commit 526096840e
2349 changed files with 19464 additions and 0 deletions

20
assets/data/facets.json Normal file
View File

@@ -0,0 +1,20 @@
---
# facets generator
# creates a csv of unique values and their counts of fields given in site.data.theme.metadata-facets-fields
#
# Requires CB's array_count_uniq.rb plugin!
---
{%- assign items = site.data[site.metadata] | where_exp: 'item','item.objectid' -%}
{%- assign fields = site.data.theme.metadata-facets-fields | split: "," -%}
{
"facets": [
{% for f in fields %}{%- assign uniqueArray = items | map: f | join: ";" | downcase | split: ";" | array_count_uniq -%}
{
"field": {{ f | jsonify }},
"terms": { {% for unique in uniqueArray %}
{{ unique[0] | jsonify }}: {{ unique[1] | jsonify }}{% unless forloop.last %},{% endunless %}{% endfor %}
}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}