mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 20:14:15 +00:00
BREAKING CHANGE Module paths moved to `github.com/HugoBlox/kit` with new names: - core `blox-tailwind` → `blox` - analytics → `analytics` - netlify → `integrations/netlify` - slides (reveal) → `slides` Update go.mod, module.yaml/params, scripts, tests, and v0.11 migration guide accordingly.
16 lines
733 B
HTML
16 lines
733 B
HTML
{{/* HBX resolver: maps a section { block: "<id>", ... } to the block partial.
|
|
This resolver looks up blocks from the blox/<block-id>/block.html structure,
|
|
which are mounted to layouts/_partials/hbx/blocks/<block-id>/block.html via module.yaml.
|
|
*/}}
|
|
{{- $id := .section.block -}}
|
|
{{- if not $id }}{{ errorf "HBX: section is missing 'block' key: %v" .section }}{{ end -}}
|
|
|
|
{{- $params := .section -}}
|
|
{{- $path := printf "hbx/blocks/%s/block.html" $id -}}
|
|
|
|
{{- if templates.Exists (printf "_partials/%s" $path) -}}
|
|
{{ partial $path (dict "wcPage" .ctx "wcBlock" $params "wcIdentifier" ($params.id | default (printf "section-%s" $id))) }}
|
|
{{- else -}}
|
|
{{ errorf "HBX: block '%s' not found at %q" $id $path }}
|
|
{{- end -}}
|