From f82137031e87f190309990d6db490c8033bbebe1 Mon Sep 17 00:00:00 2001 From: sebousan Date: Tue, 8 Sep 2026 15:57:38 +0200 Subject: [PATCH 1/3] refactor: standardize collection path/slug partials --- layouts/partials/admin/collections/types/expertises.yml | 2 +- layouts/partials/admin/collections/types/persons.yml | 2 +- layouts/partials/admin/collections/types/posts.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/admin/collections/types/expertises.yml b/layouts/partials/admin/collections/types/expertises.yml index 9aca0e3..61ec0e9 100644 --- a/layouts/partials/admin/collections/types/expertises.yml +++ b/layouts/partials/admin/collections/types/expertises.yml @@ -7,7 +7,7 @@ i18n: true, {{ partial "admin/collections/config/create.yml" . }} {{ partial "admin/collections/config/preview.yml" . }} - {{ partial "admin/collections/config/path.yml" "{{slug}}" }} + {{ partial "admin/collections/config/path.yml" . }} {{ partial "admin/collections/config/slug.yml" . }} {{ partial "admin/collections/types/_default.yml" . }} diff --git a/layouts/partials/admin/collections/types/persons.yml b/layouts/partials/admin/collections/types/persons.yml index 5a46fcb..3cd78fd 100644 --- a/layouts/partials/admin/collections/types/persons.yml +++ b/layouts/partials/admin/collections/types/persons.yml @@ -7,7 +7,7 @@ i18n: true, {{ partial "admin/collections/config/create.yml" . }} {{ partial "admin/collections/config/preview.yml" . }} - {{ partial "admin/collections/config/path.yml" "{{slug}}" }} + {{ partial "admin/collections/config/path.yml" . }} {{ partial "admin/collections/config/slug.yml" . }} {{ partial "admin/collections/types/_default.yml" . }} diff --git a/layouts/partials/admin/collections/types/posts.yml b/layouts/partials/admin/collections/types/posts.yml index 45891e2..933a4fb 100644 --- a/layouts/partials/admin/collections/types/posts.yml +++ b/layouts/partials/admin/collections/types/posts.yml @@ -7,8 +7,8 @@ i18n: true, {{ partial "admin/collections/config/create.yml" . }} {{ partial "admin/collections/config/preview.yml" . }} - {{ partial "admin/collections/config/path.yml" "{{year}}/{{month}}/{{slug}}" }} - {{ partial "admin/collections/config/slug.yml" "{{year}}-{{month}}-{{day}}-{{slug}}" }} + {{ partial "admin/collections/config/path.yml" . }} + {{ partial "admin/collections/config/slug.yml" . }} {{ partial "admin/collections/types/_default.yml" . }} } \ No newline at end of file From 70a658b864b3254c1410facefa4106240530ae47 Mon Sep 17 00:00:00 2001 From: sebousan Date: Tue, 8 Sep 2026 15:58:10 +0200 Subject: [PATCH 2/3] feat: enable nested subfolders with dynamic depth configuration and cache context for CMS collections --- .../partials/admin/cms/decapcms/collection/config/nested.yml | 4 +++- .../partials/admin/cms/decapcms/collection/config/parent.yml | 3 ++- .../partials/admin/cms/staticcms/collection/config/nested.yml | 2 +- .../partials/admin/cms/staticcms/collection/config/parent.yml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/layouts/partials/admin/cms/decapcms/collection/config/nested.yml b/layouts/partials/admin/cms/decapcms/collection/config/nested.yml index 30e60a9..11f498f 100644 --- a/layouts/partials/admin/cms/decapcms/collection/config/nested.yml +++ b/layouts/partials/admin/cms/decapcms/collection/config/nested.yml @@ -2,6 +2,8 @@ {{ if gt $nested 1 }} nested: { depth: {{ $nested }}, + subfolders: true, + summary: '{{`{{title}}`}}' }, -{{ partialCached "admin/cms/decapcms/collection/config/parent.yml" . }} +{{ partialCached "admin/cms/decapcms/collection/config/parent.yml" . . }} {{ end }} \ No newline at end of file diff --git a/layouts/partials/admin/cms/decapcms/collection/config/parent.yml b/layouts/partials/admin/cms/decapcms/collection/config/parent.yml index 47ba46e..94e3a3b 100644 --- a/layouts/partials/admin/cms/decapcms/collection/config/parent.yml +++ b/layouts/partials/admin/cms/decapcms/collection/config/parent.yml @@ -1,4 +1,5 @@ -{{ if gt site.Params.admin.nested.depth 2 }} +{{ $nested := (index site.Params.admin.collections .).nested.depth | default site.Params.admin.nested.depth }} +{{ if gt $nested 2 }} meta: { path: { label: '{{ i18n "admin.fields.parent.label" }}', diff --git a/layouts/partials/admin/cms/staticcms/collection/config/nested.yml b/layouts/partials/admin/cms/staticcms/collection/config/nested.yml index 6360656..4ae6887 100644 --- a/layouts/partials/admin/cms/staticcms/collection/config/nested.yml +++ b/layouts/partials/admin/cms/staticcms/collection/config/nested.yml @@ -4,5 +4,5 @@ nested: { depth: {{ $nested }}, summary: '{{`{{title}}`}}' }, -{{ partialCached "admin/cms/staticcms/collection/config/parent.yml" . }} +{{ partialCached "admin/cms/staticcms/collection/config/parent.yml" . . }} {{ end }} diff --git a/layouts/partials/admin/cms/staticcms/collection/config/parent.yml b/layouts/partials/admin/cms/staticcms/collection/config/parent.yml index 47ba46e..94e3a3b 100644 --- a/layouts/partials/admin/cms/staticcms/collection/config/parent.yml +++ b/layouts/partials/admin/cms/staticcms/collection/config/parent.yml @@ -1,4 +1,5 @@ -{{ if gt site.Params.admin.nested.depth 2 }} +{{ $nested := (index site.Params.admin.collections .).nested.depth | default site.Params.admin.nested.depth }} +{{ if gt $nested 2 }} meta: { path: { label: '{{ i18n "admin.fields.parent.label" }}', From bb447ddfdd49f9283fa9bb0bd33812c47d52782e Mon Sep 17 00:00:00 2001 From: anupamme Date: Tue, 8 Sep 2026 14:32:12 +0000 Subject: [PATCH 3/3] harden: sanitize child_process call in build-config-cloudcannon.js Detected calls to child_process from a function argument `command` Addresses javascript.lang.security.detect-child-process.detect-child-process --- scripts/build-config-cloudcannon.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build-config-cloudcannon.js b/scripts/build-config-cloudcannon.js index f11aae7..f2a32a9 100644 --- a/scripts/build-config-cloudcannon.js +++ b/scripts/build-config-cloudcannon.js @@ -16,15 +16,16 @@ * @requires path */ -const { exec } = require('child_process'); +const { execFile } = require('child_process'); const fs = require('fs'); const path = require('path'); -// Function to execute a shell command +// Function to execute a command without invoking a shell (avoids command injection) function runCommand(command) { return new Promise((resolve, reject) => { console.log(`Executing: ${command}`); - const process = exec(command); + const [cmd, ...args] = command.split(' '); + const process = execFile(cmd, args); process.stdout.on('data', (data) => { console.log(data.toString());