Make some page settings also configurable site wide (#182)

Adds **local** and **global** param to following front-matter vars:
- hideMeta
- ShowToc
- TocOpen
- comments

Co-authored-by: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
This commit is contained in:
Florian Kohrt 2021-01-17 07:55:35 +01:00 committed by GitHub
parent 8222f2bd11
commit 2b3baf94bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@
<line x1="21" y1="21" x2="16.65" y2="16.65"></line> <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg> </svg>
</h1> </h1>
{{- if .Params.hideMeta }}{{ else }} {{- if not (.Param "hideMeta") }}
<div class="post-meta"> <div class="post-meta">
{{- if .IsTranslated -}} {{- if .IsTranslated -}}
<ul class="i18n_list"> <ul class="i18n_list">

View File

@ -9,7 +9,7 @@
<div class="post-description"> <div class="post-description">
{{ .Description }} {{ .Description }}
</div> </div>
{{- if .Params.hideMeta }}{{ else }} {{- if not (.Param "hideMeta") }}
<div class="post-meta"> <div class="post-meta">
{{- partial "post_meta.html" . -}} {{- partial "post_meta.html" . -}}
{{- if .IsTranslated -}}&nbsp;|&nbsp; {{- if .IsTranslated -}}&nbsp;|&nbsp;
@ -33,9 +33,9 @@
</header> </header>
{{- $isHidden := ((.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInSingle) | default .Params.cover.hidden )}} {{- $isHidden := ((.Site.Params.cover.hidden | default .Site.Params.cover.hiddenInSingle) | default .Params.cover.hidden )}}
{{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }} {{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
{{- if .Params.ShowToc }} {{- if (.Param "ShowToc") }}
<div class="toc"> <div class="toc">
<details {{if .Params.TocOpen }} open{{ end }}> <details {{if (.Param "TocOpen") }} open{{ end }}>
<summary accesskey="c" title="(Alt + C)"> <summary accesskey="c" title="(Alt + C)">
<div class="details">{{- i18n "toc" | default "Table of Contents" }}</div> <div class="details">{{- i18n "toc" | default "Table of Contents" }}</div>
</summary> </summary>
@ -61,7 +61,7 @@
{{- end }} {{- end }}
</footer> </footer>
{{- if and ($.Site.Params.comments) (ne .Params.comments false) }} {{- if (.Param "comments") }}
{{- partial "comments.html" . }} {{- partial "comments.html" . }}
{{- end }} {{- end }}
</article> </article>