summaryrefslogtreecommitdiff
path: root/layouts/partials/toc.html
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-09-23 12:52:32 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-09-23 12:52:32 +0530
commit016dd6e9fae2cff965753c0fe865e11a58018101 (patch)
tree8ee6d6ff897612d29d0e0756dddd80b7e6cf5c4d /layouts/partials/toc.html
parent2cb5c9dad5b176fa03ebe72b04c0cd0f63100343 (diff)
(lint) remove unnecessary whitespace
created by hugo's {{ }}
Diffstat (limited to 'layouts/partials/toc.html')
-rw-r--r--layouts/partials/toc.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index f3146dc..06053b6 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -24,10 +24,10 @@
{{- $headerLevel := len (seq $headerLevel) -}}
{{/* get id="xyz" */}}
- {{ $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }}
+ {{- $id := index (findRE "(id=\"(.*?)\")" $header 9) 0 }}
- {{/* strip id="" to leave xyz (no way to get regex capturing groups in hugo :( */}}
- {{ $cleanedID := replace (replace $id "id=\"" "") "\"" "" }}
+ {{- /* strip id="" to leave xyz, no way to get regex capturing groups in hugo */ -}}
+ {{- $cleanedID := replace (replace $id "id=\"" "") "\"" "" }}
{{- $header := replaceRE "<h[1-4].*?>((.|\n])+?)</h[1-4]>" "$1" $header -}}
{{- if ne $i 0 -}}
@@ -69,7 +69,7 @@
{{- end -}}
{{- end -}}
<!-- {{- $firstHeaderLevel := len (seq (index (findRE "[1-4]" (index $headers 0) 1) 0)) -}} -->
- {{ $firstHeaderLevel := $largest }}
+ {{- $firstHeaderLevel := $largest }}
{{- $lastHeaderLevel := len (seq (index (findRE "[1-4]" (index $headers (sub (len $headers) 1)) 1) 0)) -}}
</li>
{{- range seq (sub $lastHeaderLevel $firstHeaderLevel) -}}