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

github.com/kakawait/hugo-tranquilpeak-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaud Lepretre <thibaud.lepretre@gmail.com>2021-08-07 14:49:57 +0300
committerThibaud Lepretre <thibaud.lepretre@gmail.com>2021-08-11 15:04:00 +0300
commita98bf8ca122e88fc7d108a2360b02870a124b72c (patch)
tree4d875fb75f6e62c0dd2c955a904075c595c9cdb6 /layouts
parent6713b3fb8d6170a342521cd36c2c8d0026b33535 (diff)
Add new shortcode toc to support new markup
fixes #395
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/single.html2
-rw-r--r--layouts/shortcodes/toc.html2
2 files changed, 3 insertions, 1 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 19c55b8..d00724c 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -17,7 +17,7 @@
{{ end }}
<div class="post-content markdown">
<div class="main-content-wrap">
- {{ (replaceRE "<!--\\s*[t|T][o|O][c|C]\\s*-->" (printf "<h1 id=\"table-of-contents\">%s</h1>%s" (i18n "post.toc") .TableOfContents) .Content) | safeHTML }}
+ {{ .Content }}
{{ partial "post/gallery.html" . }}
</div>
</div>
diff --git a/layouts/shortcodes/toc.html b/layouts/shortcodes/toc.html
new file mode 100644
index 0000000..669f274
--- /dev/null
+++ b/layouts/shortcodes/toc.html
@@ -0,0 +1,2 @@
+<h1 id="table-of-contents">{{ i18n "post.toc" }}</h1>
+{{ .Page.TableOfContents }}