Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/qqhann/hugo-primer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/_default/single.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 2fc350e..b735167 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -45,8 +45,11 @@
{{ define "side" }}
{{ if and (gt .WordCount 0 ) (ne .Params.toc "false") }}
<div id="toc" class="Box Box--blue mb-3">
- <b>{{.Title}}</b>
- {{ .TableOfContents }}
+ <b>{{ .Title }}</b>
+ {{- $toc := .TableOfContents -}}
+ {{- $toc := replaceRE `<nav id="TableOfContents">\n<ul>\n<li>\n<ul>` `<nav id="TableOfContents"><ul>` $toc -}}
+ {{- $toc := replaceRE `</ul>\n</li>\n</ul>\n</nav>` `</ul>\n</nav>` $toc -}}
+ {{- safeHTML $toc -}}
</div>
{{ end }}