mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 00:14:05 +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.
22 lines
819 B
HTML
22 lines
819 B
HTML
{{/* Pragmatic deep merge for block sections: shallow merge + merge 'content' and 'design' submaps if present. b overrides a. */}}
|
|
{{- $a := .a -}}
|
|
{{- $b := .b -}}
|
|
{{- if and (reflect.IsMap $a) (reflect.IsMap $b) -}}
|
|
{{- $result := merge $a $b -}}
|
|
{{- /* merge 'content' submap */ -}}
|
|
{{- $ac := index $a "content" -}}
|
|
{{- $bc := index $b "content" -}}
|
|
{{- if and (reflect.IsMap $ac) (reflect.IsMap $bc) -}}
|
|
{{- $result = merge $result (dict "content" (merge $ac $bc)) -}}
|
|
{{- end -}}
|
|
{{- /* merge 'design' submap */ -}}
|
|
{{- $ad := index $a "design" -}}
|
|
{{- $bd := index $b "design" -}}
|
|
{{- if and (reflect.IsMap $ad) (reflect.IsMap $bd) -}}
|
|
{{- $result = merge $result (dict "design" (merge $ad $bd)) -}}
|
|
{{- end -}}
|
|
{{- return $result -}}
|
|
{{- else -}}
|
|
{{- return $b -}}
|
|
{{- end -}}
|