Files
George Cushen f4280ddb1c refactor: rename modules and update migration docs
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.
2026-01-02 20:59:48 +00:00

20 lines
679 B
HTML

{{/*
Get Block Scripts
Discovers and returns a slice of JavaScript files for blocks used on the current page.
*/}}
{{ $block_scripts := slice }}
{{ if .IsPage }}
{{/* Get the list of unique block types used on this page from the Page Store */}}
{{ $block_types := .Page.Store.Get "block_types" | default (slice) | uniq }}
{{ range $block_type := $block_types }}
{{/* Check if a JS file exists for this block type */}}
{{ $script_path := printf "js/hbx/blocks/%s/%s.js" $block_type $block_type }}
{{ with resources.Get $script_path }}
{{ $block_scripts = $block_scripts | append . }}
{{ end }}
{{ end }}
{{ end }}
{{ return $block_scripts }}