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

github.com/StaticMania/portio-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordnth <dickson.neoh@gmail.com>2022-02-19 12:26:34 +0300
committerdnth <dickson.neoh@gmail.com>2022-02-19 12:26:34 +0300
commitddf8123c115507f6be30b4cb3be3973594b76cf5 (patch)
treee833487ab63fe9b54a72ae625a7bfde2148884ad
parentd9d48ee7fec0c4f7967a6b821eb5c23aa69fb260 (diff)
add toc
-rw-r--r--layouts/blog/single.html5
1 files changed, 5 insertions, 0 deletions
diff --git a/layouts/blog/single.html b/layouts/blog/single.html
index 822003f..eb9bb75 100644
--- a/layouts/blog/single.html
+++ b/layouts/blog/single.html
@@ -80,6 +80,11 @@
<div class="row mt-5">
<div class="col-lg-12">
<div class="singleBlog__content">
+
+ {{ if .Params.toc }}
+ <h3>Table of Contents</h3>
+ {{ .TableOfContents | replaceRE "<ul>[[:space:]]*<li>[[:space:]]*<ul>" "<ul>" | replaceRE "</ul>[[:space:]]*</li>[[:space:]]*</ul>" "</ul>" | safeHTML }}
+ {{ end }}
{{ .Content }}
</div>
</div>