toggle comments at front matter

Whether the comment show up was determined by if the page is under
mainSection, now it's determined by front matter and config.toml
This commit is contained in:
leafee98 2022-05-18 21:13:49 +08:00
parent 836128c866
commit e2ca0c5332
3 changed files with 4 additions and 3 deletions

View file

@ -3,6 +3,8 @@ title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
tags: []
categories: []
weight: 50
show_comments: true
draft: true
---

View file

@ -39,9 +39,8 @@
{{ .Content }}
</div>
{{ if in .Site.Params.mainSections .Type }}
{{ with and .Site.Params.remark42 .Params.show_comments }}
<hr />
{{ partial "comment.html" . }}
{{ end }}
</section>

View file

@ -11,7 +11,7 @@
<script>mermaid.initialize({ startOnLoad: true });</script>
{{ end }}
{{ with .Site.Params.remark42 }}
{{ with and .Site.Params.remark42 .Params.show_comments }}
<script>
var remark_config = {
host: '{{ .host }}',