Skip to content

Commit

Permalink
toggle comments at front matter
Browse files Browse the repository at this point in the history
Whether the comment show up was determined by if the page is under
mainSection, now it's determined by front matter and config.toml
  • Loading branch information
leafee98 committed May 18, 2022
1 parent 836128c commit e2ca0c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions exampleSite/archetypes/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
tags: []
categories: []
weight: 50
show_comments: true
draft: true
---

Expand Down
3 changes: 1 addition & 2 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ <h1 class="title">{{ .Title }}</h1>
{{ .Content }}
</div>

{{ if in .Site.Params.mainSections .Type }}
{{ with and .Site.Params.remark42 .Params.show_comments }}
<hr />

{{ partial "comment.html" . }}
{{ end }}
</section>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}',
Expand Down

0 comments on commit e2ca0c5

Please sign in to comment.