mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
3e8bdfd8f9
* ⚡ Perf: adjust global/site scope state management * ⚡ Perf: adjust page scope state management
13 lines
381 B
HTML
13 lines
381 B
HTML
{{- /* ID */ -}}
|
|
{{- $noop := .Page.WordCount -}}
|
|
{{- $id := "" -}}
|
|
{{- with .Id -}}
|
|
{{- /* If an ID is specified, then just use it.*/ -}}
|
|
{{- $id = printf "%v" . -}}
|
|
{{- else -}}
|
|
{{- $count := ($.Page.Store.Get "this").count | default 1 -}}
|
|
{{- $id = printf "id-%d" $count -}}
|
|
{{- $count | add 1 | $.Page.Store.SetInMap "this" "count" -}}
|
|
{{- end -}}
|
|
{{- return $id -}}
|