diff options
author | dnth <dickson.neoh@gmail.com> | 2022-02-19 12:26:34 +0300 |
---|---|---|
committer | dnth <dickson.neoh@gmail.com> | 2022-02-19 12:26:34 +0300 |
commit | ddf8123c115507f6be30b4cb3be3973594b76cf5 (patch) | |
tree | e833487ab63fe9b54a72ae625a7bfde2148884ad | |
parent | d9d48ee7fec0c4f7967a6b821eb5c23aa69fb260 (diff) |
add toc
-rw-r--r-- | layouts/blog/single.html | 5 |
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> |