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

github.com/puresyntax71/hugo-theme-chunky-poster.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpuresyntax71 <34715246+puresyntax71@users.noreply.github.com>2020-01-04 17:44:05 +0300
committerpuresyntax71 <34715246+puresyntax71@users.noreply.github.com>2020-01-27 12:31:16 +0300
commit1b66c64c791c35146f232f26e9f21814e60b45bb (patch)
tree1b21eb421752bd90a29146aafe9b625a8ee4b79d
parent6144df02b9b6070a6d5690bb3511e60324ca6928 (diff)
Add TOC.
-rwxr-xr-xexampleSite/content/post/markdown-syntax.md1
-rw-r--r--layouts/post/single.html7
2 files changed, 8 insertions, 0 deletions
diff --git a/exampleSite/content/post/markdown-syntax.md b/exampleSite/content/post/markdown-syntax.md
index 9b8abac..32d1393 100755
--- a/exampleSite/content/post/markdown-syntax.md
+++ b/exampleSite/content/post/markdown-syntax.md
@@ -20,6 +20,7 @@ aliases = ["migrate-from-jekyl"]
images = [
"markdown-syntax.jpg",
]
+toc = true
+++
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.
diff --git a/layouts/post/single.html b/layouts/post/single.html
index e425da4..9249e45 100644
--- a/layouts/post/single.html
+++ b/layouts/post/single.html
@@ -33,6 +33,13 @@
{{- end -}}
<div class="row justify-content-center">
+ {{- if .Params.toc -}}
+ <div class="col-lg-3 pl-0 table-of-contents">
+ <div class="sticky-top" style="top: 100px;">
+ {{ .TableOfContents }}
+ </div>
+ </div>
+ {{- end -}}
<div class="col-lg-8">
<div class="content">
{{ $page.Content }}