From 73bfa82afdba882375f3b7be1b902811bac4f01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Mon, 30 Oct 2023 21:05:00 +0100 Subject: [PATCH] taxonomy: add term page content toc to index toc #705 --- layouts/partials/toc-id.html | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/layouts/partials/toc-id.html b/layouts/partials/toc-id.html index 1e9a7eb4a2..efee626f09 100644 --- a/layouts/partials/toc-id.html +++ b/layouts/partials/toc-id.html @@ -25,8 +25,6 @@ {{- else if eq .Kind "term" }} - + {{- $toc := trim (partial "toc.html" .) " \n\r\t" }} + {{- if and (not $toc) $toc_term }} + {{- $toc = printf "" }} + {{- end }} + {{- if and $toc $toc_term }} + {{- $toc = replaceRE "^()$" " ${1}" $toc }} + {{- $toc = replaceRE "([ \\t]*[\\s]*)$" (printf "%s${1}" $toc_term) $toc }} + {{- end }} +{{ $toc | safeHTML }} {{- else }} {{- partial "toc.html" . }} {{- end }} \ No newline at end of file