From b764c50ac41af349ec1607973f4cb29acad1262c Mon Sep 17 00:00:00 2001
From: suroh <mx@suroh.tk>
Date: Tue, 28 Nov 2023 17:46:18 +0100
Subject: [PATCH] updated config for decap to use beta nested files

---
 .gitignore                                    |  3 ++-
 admin/config.yml                              | 16 ++++++++----
 dist/admin/config.yml                         | 26 -------------------
 dist/admin/index.html                         | 13 ----------
 dist/index.html                               |  4 +--
 src/_content/index.md                         |  2 +-
 .../work/{chantal.md => chantal/index.md}     |  2 +-
 src/_content/work/work.json                   |  3 +++
 src/_includes/index.webc                      |  5 ++++
 src/_includes/singlePage.webc                 |  5 ----
 src/_includes/work.webc                       | 19 ++++++++++++++
 11 files changed, 44 insertions(+), 54 deletions(-)
 delete mode 100644 dist/admin/config.yml
 delete mode 100644 dist/admin/index.html
 rename src/_content/work/{chantal.md => chantal/index.md} (95%)
 create mode 100644 src/_content/work/work.json
 create mode 100644 src/_includes/index.webc
 delete mode 100644 src/_includes/singlePage.webc
 create mode 100644 src/_includes/work.webc

diff --git a/.gitignore b/.gitignore
index b9c0abe..752dbbe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,4 +59,5 @@ typings/
 .env
 
 # 11ty ignores
-_site/
\ No newline at end of file
+_site/
+dist/
diff --git a/admin/config.yml b/admin/config.yml
index b930da9..468a5f3 100644
--- a/admin/config.yml
+++ b/admin/config.yml
@@ -13,14 +13,20 @@ media_folder: "src/assets/images/uploads"
 public_folder: "/images/uploads"
 
 collections:
-- label: "Work"
-  name: "work"
+- name: "work"
+  label: "Work"
+  label_singluar: "Work"
   folder: "src/_content/work"
   create: true
+  nested:
+    depth: 2
+    summary: "{{ title }}"
   fields:
     - {label: "Title", name: "title", widget: "string"}
-    - {label: "Tags", name: "tags", widget: "list"}
+    - {label: "Sub-title", name: "subtitle", widget: "string"}
+    - {label: "Data", name: "data", widget: "list", fields: [ { label: "Name", name: "name", widget: "string" }, { label: "Value", name: "value", widget: "string" }]}
+    # - {label: "Featured Image", name: "thumbnail", widget: "image"}
     - {label: "Publish Date", name: "date", widget: "datetime"}
-    - {label: "Featured Image", name: "thumbnail", widget: "image"}
-    - {label: "Metadata", name: "meta", widget: "list", fields: [ { label: "Name", name: "name", widget: "string" }, { label: "Value", name: "value", widget: "string" }]}
+    - {label: "Tags", name: "tags", widget: "list"}
     - {label: "Body", name: "body", widget: "markdown"}
+  meta: { path: { widget: string, label: 'Path', index_file: 'index' } }
diff --git a/dist/admin/config.yml b/dist/admin/config.yml
deleted file mode 100644
index b930da9..0000000
--- a/dist/admin/config.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-backend:
-  name: gitea
-  repo: suroh/pxls.homepage
-  app_id: a9e54ea3-6ab8-455f-bd3d-6149f3859f4e
-  api_root: https://git.suroh.tk/api/v1
-  base_url: https://git.suroh.tk
-  site_domain: localhost:8080
-  branch: main
-
-site_url: http://localhost:8080
-
-media_folder: "src/assets/images/uploads"
-public_folder: "/images/uploads"
-
-collections:
-- label: "Work"
-  name: "work"
-  folder: "src/_content/work"
-  create: true
-  fields:
-    - {label: "Title", name: "title", widget: "string"}
-    - {label: "Tags", name: "tags", widget: "list"}
-    - {label: "Publish Date", name: "date", widget: "datetime"}
-    - {label: "Featured Image", name: "thumbnail", widget: "image"}
-    - {label: "Metadata", name: "meta", widget: "list", fields: [ { label: "Name", name: "name", widget: "string" }, { label: "Value", name: "value", widget: "string" }]}
-    - {label: "Body", name: "body", widget: "markdown"}
diff --git a/dist/admin/index.html b/dist/admin/index.html
deleted file mode 100644
index fdaa17a..0000000
--- a/dist/admin/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!doctype html>
-<html>
-<head>
-  <meta charset="utf-8" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <meta name="robots" content="noindex" />
-  <title>11ty : admin</title>
-</head>
-<body>
-  <!-- Include the script that builds the page and powers Decap CMS -->
-  <script src="https://cdn.jsdelivr.net/npm/decap-cms@^3.0.0/dist/decap-cms.js"></script>
-</body>
-</html>
diff --git a/dist/index.html b/dist/index.html
index 036225b..dba8b6e 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -16,9 +16,9 @@
 
 <body>
   <!-- template content -->
-  <div class="single-page"><h1>index</h1>
+  <main><h1>index</h1>
 <p>the index page.</p>
-</div>
+</main>
 
 
 
diff --git a/src/_content/index.md b/src/_content/index.md
index 31cc588..ef4d2a9 100644
--- a/src/_content/index.md
+++ b/src/_content/index.md
@@ -1,6 +1,6 @@
 ---
 title: index
-layout: singlePage.webc
+layout: index.webc
 ---
 
 # index
diff --git a/src/_content/work/chantal.md b/src/_content/work/chantal/index.md
similarity index 95%
rename from src/_content/work/chantal.md
rename to src/_content/work/chantal/index.md
index ed9b0e7..d7f36f3 100644
--- a/src/_content/work/chantal.md
+++ b/src/_content/work/chantal/index.md
@@ -17,4 +17,4 @@ Chloë Janssens, INSIDE (the ears, the audio)\
 Marko Gutić Mižimakov, OBJECT (the eyes, the video)\
 Anna Lugmeier, SUBJECT (the guide)
 
-Four people experiment with relational hood group around a tree in which the name Chantal is inscribed. The call was a re-imagining and re-assembling of Lygia Clark's relational object works, involving a group call, selfie sticks and a hood like costume that covered one of the participants heads.
\ No newline at end of file
+Four people experiment with relational hood group around a tree in which the name Chantal is inscribed. The call was a re-imagining and re-assembling of Lygia Clark's relational object works, involving a group call, selfie sticks and a hood like costume that covered one of the participants heads.
diff --git a/src/_content/work/work.json b/src/_content/work/work.json
new file mode 100644
index 0000000..0c9d695
--- /dev/null
+++ b/src/_content/work/work.json
@@ -0,0 +1,3 @@
+{
+  "layout": "work.webc"
+}
diff --git a/src/_includes/index.webc b/src/_includes/index.webc
new file mode 100644
index 0000000..3893d5e
--- /dev/null
+++ b/src/_includes/index.webc
@@ -0,0 +1,5 @@
+---
+layout: base.webc
+---
+
+<main @html="content"></main>
diff --git a/src/_includes/singlePage.webc b/src/_includes/singlePage.webc
deleted file mode 100644
index 7ad4b9f..0000000
--- a/src/_includes/singlePage.webc
+++ /dev/null
@@ -1,5 +0,0 @@
----
-layout: base.webc
----
-
-<div class="single-page" @html="content"></div>
diff --git a/src/_includes/work.webc b/src/_includes/work.webc
new file mode 100644
index 0000000..7dd8879
--- /dev/null
+++ b/src/_includes/work.webc
@@ -0,0 +1,19 @@
+---
+layout: base.webc
+---
+
+<aside>
+  <h2 @text="title"></h2>
+  <span @text="subtitle"></span>
+
+  <div class="meta">
+    <div webc:for="(k,m) in meta">
+      <div @text="m.name"></div>
+      <div @html="m.value"></div>
+    </div>
+  </div>
+
+  <article @html="content"></article>
+</aside>
+
+<main></main>