diff options
author | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2017-12-05 22:32:09 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2017-12-05 22:32:09 +0800 |
commit | 8c078104847c7f0698407a3b97ab106f43d6aad2 (patch) | |
tree | 5b540744b531f1b1c659d1bc0a2b3aba33cab5f5 /layouts/partials | |
parent | c6a71c268bc7a8b1e94174fa754dee9d5c10bf67 (diff) |
fix: compatible with config.toml file without the `autoCollapseToc` parameter
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/post/toc.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/layouts/partials/post/toc.html b/layouts/partials/post/toc.html index 1cb7804..35e6da6 100644 --- a/layouts/partials/post/toc.html +++ b/layouts/partials/post/toc.html @@ -1,8 +1,9 @@ {{ if and .Site.Params.toc (ne .Params.toc false) }} <div class="post-toc" id="post-toc"> <h2 class="post-toc-title">{{ .Site.Data.even.default.posts.toc }}</h2> - <div class="post-toc-content{{ if or .Params.autoCollapseToc (and .Site.Params.autoCollapseToc (ne .Params.autoCollapseToc false)) | not }} always-active{{ end }}"> - {{.TableOfContents}} + {{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }} + <div class="post-toc-content{{ if not (or .Params.autoCollapseToc (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false))) }} always-active{{ end }}"> + {{.TableOfContents}} </div> </div> {{- end }}
\ No newline at end of file |