From af0737867be13101e19489c0062e2f9b94659bff Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Wed, 18 Mar 2026 07:14:47 +0100 Subject: [PATCH] feat(structures): add group and sidecar support for LLM integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add \`group: partial\` to utility structure files (bundle, dependency, description, get-contact, log, urljoin) to suppress them from LLM component output - Extend InitTypes to load augmented sidecar YAML files for Bookshop components, enabling icon, example, and children metadata without modifying upstream blueprint files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 --- data/structures/bundle.yml | 1 + data/structures/dependency.yml | 1 + data/structures/description.yml | 1 + data/structures/get-contact.yml | 1 + data/structures/log.yml | 1 + data/structures/urljoin.yml | 1 + layouts/_partials/utilities/InitTypes.html | 13 +++++++++++++ 7 files changed, 19 insertions(+) diff --git a/data/structures/bundle.yml b/data/structures/bundle.yml index 0d05711..171d77a 100644 --- a/data/structures/bundle.yml +++ b/data/structures/bundle.yml @@ -1,5 +1,6 @@ comment: >- Bundles a selection of files into a single file. +group: partial arguments: page: match: diff --git a/data/structures/dependency.yml b/data/structures/dependency.yml index 07178f8..6532c3b 100644 --- a/data/structures/dependency.yml +++ b/data/structures/dependency.yml @@ -3,6 +3,7 @@ comment: >- the requirement as semantic version string, e.g. `0.141.0`. The function returns true if Hugo's major version is equal and the minor.patch version is equal or greater than the provided version string. Any labels are ignored. +group: partial arguments: version: type: string diff --git a/data/structures/description.yml b/data/structures/description.yml index 207378e..03327d1 100644 --- a/data/structures/description.yml +++ b/data/structures/description.yml @@ -1,4 +1,5 @@ comment: Retrieves the (meta) description of a page. +group: partial arguments: page: type: diff --git a/data/structures/get-contact.yml b/data/structures/get-contact.yml index 8bc2061..56fbfb9 100644 --- a/data/structures/get-contact.yml +++ b/data/structures/get-contact.yml @@ -1,5 +1,6 @@ comment: >- Retrieves contact details by name from a data asset. +group: partial arguments: contact: type: string diff --git a/data/structures/log.yml b/data/structures/log.yml index a9c10aa..b5488fc 100644 --- a/data/structures/log.yml +++ b/data/structures/log.yml @@ -1,4 +1,5 @@ comment: Logs a rich warning or error to the terminal. +group: partial arguments: type: type: select diff --git a/data/structures/urljoin.yml b/data/structures/urljoin.yml index 7a59831..6ab9a2d 100644 --- a/data/structures/urljoin.yml +++ b/data/structures/urljoin.yml @@ -2,6 +2,7 @@ comment: >- Joins the provided elements into a URL string. This partial uses urls.JoinPath introduced by Hugo v0.112.0 when available. Only use this partial when depending on an older version of Hugo. +group: partial arguments: base: type: string diff --git a/layouts/_partials/utilities/InitTypes.html b/layouts/_partials/utilities/InitTypes.html index ccb96c4..198dcc6 100644 --- a/layouts/_partials/utilities/InitTypes.html +++ b/layouts/_partials/utilities/InitTypes.html @@ -102,6 +102,19 @@ {{ else }} {{ $args = index (index (index site.Data.structures.components $bookshop) (printf "%s.bookshop" $bookshop)) "blueprint" | default dict }} {{ $args = merge $args (dict "_bookshop_name" nil "_ordinal" nil "id" nil) }} + {{/* Load augmented sidecar (e.g. preview.yml) if present */}} + {{ $sidecarData := index (index site.Data.structures.components $bookshop) $bookshop | default dict }} + {{ range $key, $sidecarArgDef := ($sidecarData.arguments | default dict) }} + {{ if reflect.IsMap $sidecarArgDef }} + {{/* Convert kebab sidecar key to snake_case to match blueprint key format */}} + {{ $snakeKey := replaceRE "-" "_" $key }} + {{ $existing := index $args $snakeKey | default (index $args $key) | default dict }} + {{ if not (reflect.IsMap $existing) }}{{ $existing = dict }}{{ end }} + {{/* Prefer snake key if it exists in blueprint, otherwise use as-is */}} + {{ $targetKey := cond (isset $args $snakeKey) $snakeKey $key }} + {{ $args = merge $args (dict $targetKey (merge $existing $sidecarArgDef)) }} + {{ end }} + {{ end }} {{ end }} {{/* Merge any child arguments */}}