File tree Expand file tree Collapse file tree 5 files changed +16
-10
lines changed Expand file tree Collapse file tree 5 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ set /p version=<..\layouts\partials\version.txt
33echo %version% > metrics.%version% .txt
44echo disableAssetsBusting=true>> config.toml
55echo disableGeneratorVersion=true>> config.toml
6+ echo disableRandomIds=true>> config.toml
67hugo --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version% >> metrics.%version% .txt
78move /Y metrics.%version% .txt public.%version% \metrics.txt 2 >& 1 > NUL
89git restore config.toml
Original file line number Diff line number Diff line change 1- {{- $random := "" }}
2- {{- $set := split "012345abcdefghijklmnopqrstuvwxyz" "" }}
3- {{- range (seq 16) }}
4- {{- with ($set | shuffle | first 1) }}
5- {{- $random = printf "%s%s" $random . }}
1+ {{- $context := . }}
2+ {{- if (ne $context.Site.Params.disableRandomIds true) }}
3+ {{- $random := "" }}
4+ {{- $set := split "012345abcdefghijklmnopqrstuvwxyz" "" }}
5+ {{- range (seq 16) }}
6+ {{- with ($set | shuffle | first 1) }}
7+ {{- $random = printf "%s%s" $random . }}
8+ {{- end }}
69 {{- end }}
7- {{- end }}
8- {{- md5 $random }}
10+ {{- md5 $random }}
11+ {{- else }}
12+ {{- printf "00000000000000000000000000000000" }}
13+ {{- end }}
Original file line number Diff line number Diff line change 66{{- if eq (printf "%T" $expanded) "string" }}
77 {{- $expanded = (eq $expanded "true") }}
88{{- end }}
9- {{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo") .id }}
9+ {{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $context.Page ) .id }}
1010{{- with $context }}
1111< div class ="expand ">
1212 < input type ="checkbox " id ="expand-{{ $id }} " aria-controls ="expandcontent-{{ $id }} " {{ if $expanded }} checked{{ end }} >
Original file line number Diff line number Diff line change 3333 {{ $width = . }}
3434 {{- end }}
3535{{- end }}
36- {{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo") .id }}
36+ {{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $context ) .id }}
3737{{- if $lightbox }}
3838< a href ="#image-{{ $id }} " class ="lightbox-link ">
3939{{- end }}
Original file line number Diff line number Diff line change 11{{- $context := .context }}
22{{- $src := .src }}
3- {{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo") .id }}
3+ {{- $id := cond (or (eq .id nil) (eq .id "")) (partial "make-random-md5.hugo" $context.Page ) .id }}
44{{- with $context }}
55{{- with .Page.Resources.Match $src }}
66 {{- range . }}
You can’t perform that action at this time.
0 commit comments