Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/structures/bundle.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
comment: >-
Bundles a selection of files into a single file.
group: partial
arguments:
page:
match:
Expand Down
1 change: 1 addition & 0 deletions data/structures/dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions data/structures/description.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
comment: Retrieves the (meta) description of a page.
group: partial
arguments:
page:
type:
Expand Down
1 change: 1 addition & 0 deletions data/structures/get-contact.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
comment: >-
Retrieves contact details by name from a data asset.
group: partial
arguments:
contact:
type: string
Expand Down
1 change: 1 addition & 0 deletions data/structures/log.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
comment: Logs a rich warning or error to the terminal.
group: partial
arguments:
type:
type: select
Expand Down
1 change: 1 addition & 0 deletions data/structures/urljoin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions layouts/_partials/utilities/InitTypes.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 */}}
Expand Down
Loading