mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 18:15:31 +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.
20 lines
400 B
HTML
20 lines
400 B
HTML
{{/*
|
|
Hugo Blox UID Generator
|
|
Generate a unique ID for shortcodes and components.
|
|
Uses the page's unique ID combined with ordinal for uniqueness.
|
|
*/}}
|
|
|
|
{{ $uid := .Page.File.UniqueID }}
|
|
{{ $ctx := . }}
|
|
|
|
{{ range seq 16 }}
|
|
{{ with $ctx }}
|
|
{{ $uid = printf "%s-%d" $uid .Ordinal }}
|
|
{{ $ctx = .Parent }}
|
|
{{ else }}
|
|
{{ break }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ return (crypto.MD5 $uid) }}
|