redesign 2023
This commit is contained in:
14
themes/FixIt/layouts/partials/function/id.html
Normal file
14
themes/FixIt/layouts/partials/function/id.html
Normal file
@ -0,0 +1,14 @@
|
||||
{{- /* ID */ -}}
|
||||
{{- $id := "" -}}
|
||||
{{- with .Id -}}
|
||||
{{- /* If an ID is specified, then just use it.*/ -}}
|
||||
{{- $id = printf "%v" . -}}
|
||||
{{- else -}}
|
||||
{{- $count := ($.Scratch.Get "this").count | default 1 -}}
|
||||
{{- $id = printf "id-%d" $count -}}
|
||||
{{- $count | add 1 | $.Scratch.SetInMap "this" "count" -}}
|
||||
{{- end -}}
|
||||
{{- with .Content -}}
|
||||
{{- dict $id . | dict "data" | dict "config" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
|
||||
{{- end -}}
|
||||
{{- return $id -}}
|
Reference in New Issue
Block a user