diff options
author | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2017-12-06 20:34:22 +0800 |
---|---|---|
committer | olOwOlo <26087907+olOwOlo@users.noreply.github.com> | 2017-12-06 20:34:22 +0800 |
commit | 1bb6eea8a84cbf67a7396abb63223f6a719aad60 (patch) | |
tree | e74741aaa70ad3002ff64aff4843a10f10cf6212 /layouts/partials | |
parent | 8c078104847c7f0698407a3b97ab106f43d6aad2 (diff) |
feat: allow set something for a single content
* Now, you can open or close toc, copyright, reward and mathjax for a single content.
* Also change the default global settings: autoCollapseToc = true -> false; mathjax = true -> false
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/post/copyright.html | 2 | ||||
-rw-r--r-- | layouts/partials/post/reward.html | 2 | ||||
-rw-r--r-- | layouts/partials/post/toc.html | 4 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/layouts/partials/post/copyright.html b/layouts/partials/post/copyright.html index cbaefb7..8a8a350 100644 --- a/layouts/partials/post/copyright.html +++ b/layouts/partials/post/copyright.html @@ -1,4 +1,4 @@ -{{ if and .Site.Params.contentCopyright (ne .Params.contentCopyright false) }} +{{ if or .Params.contentCopyright (and .Site.Params.contentCopyright (ne .Params.contentCopyright false)) }} {{ $lang := .Site.Data.even.default -}} <div class="post-copyright"> <p class="copyright-item"> diff --git a/layouts/partials/post/reward.html b/layouts/partials/post/reward.html index 7847454..35933ea 100644 --- a/layouts/partials/post/reward.html +++ b/layouts/partials/post/reward.html @@ -1,4 +1,4 @@ -{{ if and .Site.Params.reward.enable (ne .Params.reward false) }} +{{ if or .Params.reward (and .Site.Params.reward.enable (ne .Params.reward false)) }} <div class="post-reward"> {{- $lang := .Site.Data.even.default }} <input type="checkbox" name="reward" id="reward" hidden /> diff --git a/layouts/partials/post/toc.html b/layouts/partials/post/toc.html index 35e6da6..e5985c9 100644 --- a/layouts/partials/post/toc.html +++ b/layouts/partials/post/toc.html @@ -1,7 +1,7 @@ -{{ if and .Site.Params.toc (ne .Params.toc false) }} +{{ if or .Params.toc (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> - {{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }} + {{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default false }} <div class="post-toc-content{{ if not (or .Params.autoCollapseToc (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false))) }} always-active{{ end }}"> {{.TableOfContents}} </div> diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 6d4b51b..841aaa0 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -15,7 +15,7 @@ {{- end }} <script type="text/javascript" src="{{ "dist/even.min.js?v=2.7.0" | relURL }}"></script> -{{- if and (and .Site.Params.mathjax (ne .Params.mathjax false)) (or .IsPage .IsHome) }} +{{- if and (or .Params.mathjax (and .Site.Params.mathjax (ne .Params.mathjax false))) (or .IsPage .IsHome) }} <script type="text/javascript"> window.MathJax = { showProcessingMessages: false, |