diff options
Diffstat (limited to 'themes/CodeIT/layouts/_default/single.html')
-rw-r--r-- | themes/CodeIT/layouts/_default/single.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/themes/CodeIT/layouts/_default/single.html b/themes/CodeIT/layouts/_default/single.html index a34e22b..8861185 100644 --- a/themes/CodeIT/layouts/_default/single.html +++ b/themes/CodeIT/layouts/_default/single.html @@ -2,6 +2,22 @@ {{- define "content" -}} {{- $params := .Scratch.Get "params" -}} + + {{- $toc := $params.toc -}} + {{- if eq $toc true -}} + {{- $toc = .Site.Params.page.toc | default dict -}} + {{- else if eq $toc false -}} + {{- $toc = dict "enable" false -}} + {{- end -}} + + {{- /* Auto TOC */ -}} + {{- if ne $toc.enable false -}} + <div class="toc" id="toc-auto"> + <h2 class="toc-title">{{ T "contents" }}</h2> + <div class="toc-content{{ if eq $toc.auto false }} always-active{{ end }}" id="toc-content-auto"></div> + </div> + {{- end -}} + <div class="page single special"> {{- /* Title */ -}} <h1 class="single-title animated pulse faster"> @@ -13,6 +29,19 @@ <h2 class="single-subtitle">{{ . }}</h2> {{- end -}} + {{- /* Static TOC */ -}} + {{- if ne $toc.enable false -}} + <div class="details toc" id="toc-static" kept="{{ if $toc.keepStatic }}true{{ end }}"> + <div class="details-summary toc-title"> + <span>{{ T "contents" }}</span> + <span><i class="details-icon fas fa-angle-right"></i></span> + </div> + <div class="details-content toc-content" id="toc-content-static"> + {{- dict "Content" .TableOfContents "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}} + </div> + </div> + {{- end -}} + {{- /* Content */ -}} <div class="content" id="content"> {{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}} |