feat(toc): support fontawesome and ruby in TOC

This commit is contained in:
Dillon
2020-02-22 00:34:44 +08:00
parent 4e6fe224cc
commit c8fee1783a
8 changed files with 58 additions and 39 deletions

View File

@@ -52,12 +52,12 @@
{{- /* TOC */ -}}
{{- if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}}
<div class="toc-auto" id="toc-auto">
<div class="toc" id="toc-auto">
<h2 class="toc-title">{{ T "toc" }}</h2>
{{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
<div class="toc-content{{ if not (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false)) }} always-active{{ end }}" id="toc-content-auto"></div>
</div>
<div class="toc-static" id="toc-static">
<div class="toc" id="toc-static">
<details>
<summary>
<div class="toc-title">
@@ -66,7 +66,10 @@
</div>
</summary>
<div class="toc-content" id="toc-content-static">
{{- partial "single/content.html" .TableOfContents -}}
{{- $toc := .TableOfContents -}}
{{- $toc = partial "function/fontawesome.html" $toc -}}
{{- $toc = partial "function/ruby.html" $toc -}}
{{- $toc | safeHTML -}}
</div>
</details>
</div>