From 5dedbac7a3de4fcbf4d13dbeeec82dd2f277c21e6d7f201def813a6776196e54 Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Tue, 18 Jun 2024 00:00:00 +0000 Subject: Correct reference index counting --- layouts/_default/single.gmi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'layouts/_default') diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index c9b6896..5c470ab 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -37,8 +37,9 @@ {{ $chunk_refs := findRESubmatch `!?\[[\t ]*(.+?)[\t ]*\]\([\t ]*(.+?)(?:[\t ]+"(.+?)")?[\t ]*\)` $rendered_text -}} {{ range $chunk_refs -}} + {{ $ref_index = add $ref_index 1 -}} {{ $chunk_ref := dict - "index" (add $ref_index 1) + "index" $ref_index "text" (index . 1) "link" (index . 2) "title" (index . 3) -- cgit v1.2.3