From c8a5e3111141ca73cc7085dae4654c12e4b656d8 Mon Sep 17 00:00:00 2001 From: Ancocodet Date: Wed, 2 Oct 2024 13:29:38 +0200 Subject: [PATCH] Test --- _config.yml | 18 +----------------- _shop/collection.json | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 _shop/collection.json diff --git a/_config.yml b/_config.yml index 8726a18..fdb4ff8 100644 --- a/_config.yml +++ b/_config.yml @@ -1,21 +1,5 @@ source: "./" theme: jekyll-theme-cayman collections: - balls: + shop: output: true - relative_directory: _shop/_balls - caps: - output: true - relative_path: _shop/_caps - coats: - output: true - relative_directory: shop/coats - fur: - output: true - directory: _shop/_fur - items: - output: true - directory: _shop/_items - shoes: - output: true - directory: _shop/_shoes diff --git a/_shop/collection.json b/_shop/collection.json new file mode 100644 index 0000000..bcd4ccc --- /dev/null +++ b/_shop/collection.json @@ -0,0 +1,28 @@ +--- +title: Wapuugotchi collection +permalink: /collection/ +meta: [name,author,description,published,key] +--- +{ + "collections": [ + {% for collection in site.shop %}{% unless collection.label == "posts" or collection.label == "assets" or collection.label == "icons" %}{ + "items": { + {% assign filtered_items = collection.docs | where: "deactivated", 0 %}{% for item in filtered_items %}"{{ item.slug }}": { + "meta": { {% for var in page.meta %} + "{{ var }}": "{{ item[var] }}",{% endfor %} + "deactivated": {% if item.deactivated != nil %}{{ item.deactivated }}{% else %}0{% endif %}, + "priority": {% if item.priority != nil %}{{ item.priority }}{% else %}0{% endif %}, + "price": {% if item.price != nil %}{{ item.price }}{% else %}0{% endif %} + }, + "image": "{{ item.url | absolute_url | replace: "meta.html", "image.svg" }}", + "preview": "{{ item.url | absolute_url | replace: "meta.html", "preview.svg" }}" + }{% unless forloop.last %}, + {% endunless %}{% endfor %} + }, + "image": "{{ site.url }}/assets/icons/{{ collection.label }}.svg", + "slug": "{{ collection.label }}", + "caption": "{{ collection.label | capitalize }}" + }{% unless forloop.last %}, + {% endunless %}{% endunless %}{% endfor %} + ] +}