Files
hurion.eu/themes/hugo-theme-relearn/layouts/partials/_relearn/makeRandomMd5.gotmpl
2025-02-19 00:16:57 +01:00

13 lines
381 B
Go Template

{{- $page := . }}
{{- if (ne $page.Site.Params.disableRandomIds true) }}
{{- $random := "" }}
{{- $set := split "012345abcdefghijklmnopqrstuvwxyz" "" }}
{{- range (seq 16) }}
{{- with ($set | shuffle | first 1) }}
{{- $random = printf "%s%s" $random . }}
{{- end }}
{{- end }}
{{- md5 $random }}
{{- else }}
{{- printf "00000000000000000000000000000000" }}
{{- end }}