From 4e192084b2de582371eec44cd9d2796d3b109cca Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Tue, 30 Jan 2024 18:50:04 -0500 Subject: [PATCH] Fix off-by-one for codeindex --- layouts/shortcodes/codefigure.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/codefigure.html b/layouts/shortcodes/codefigure.html index 3f768ad..9041474 100644 --- a/layouts/shortcodes/codefigure.html +++ b/layouts/shortcodes/codefigure.html @@ -1,5 +1,5 @@ {{- $codeIndex := (.Page.Scratch.Get "codeIndex") -}} -{{- $id := (printf `code-%d` (sub $codeIndex 1)) -}} +{{- $id := (printf `code-%d` $codeIndex) -}} {{- with .Get "id" -}} {{- $id = . -}} {{- end -}}