🐛 Fixed the comment setting in front matter.
This commit is contained in:
parent
7c9b834729
commit
f84d590023
@ -1,10 +1,10 @@
|
||||
---
|
||||
title: "没有H1-6标题头的文章"
|
||||
description: "用于测试在没有H1-6标题头时,文章的目录导航是否会直接关闭。"
|
||||
title: "没有H1-6标题头和评论的文章"
|
||||
description: "用于测试在没有H1-6标题头时,文章的目录导航是否会直接关闭,并关闭评论功能。"
|
||||
keywords: "toc,header"
|
||||
|
||||
date: 2022-10-06T09:02:26+08:00
|
||||
lastmod: 2022-10-06T09:02:26+08:00
|
||||
lastmod: 2022-10-30T21:03:16+08:00
|
||||
|
||||
categories:
|
||||
- 示例
|
||||
@ -12,12 +12,14 @@ tags:
|
||||
- toc
|
||||
- 标题
|
||||
|
||||
comment:
|
||||
enable: false
|
||||
url: "post/no-header-title.html"
|
||||
---
|
||||
|
||||
刘慈欣2018克拉克奖获奖感言(部分内容节选)。
|
||||
|
||||
> 用于测试在没有H1-6标题头时,文章的目录导航是否会直接关闭。
|
||||
> 用于测试在没有H1-6标题头时,文章的目录导航是否会直接关闭,并关闭评论功能。
|
||||
|
||||
<!--more-->
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
{{- range $k, $v := (partialCached "init.html" .) -}}
|
||||
{{- $.Scratch.Set $k $v -}}
|
||||
{{- $.Scratch.Set $k $v -}}
|
||||
{{- end -}}
|
||||
{{ $commentEnable := .Params.comment.enable | default .Site.Params.comments.enable }}
|
||||
{{ .Scratch.Set "isComment" $commentEnable }}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}" data-theme="{{ .Scratch.Get "theme" }}">
|
||||
|
||||
@ -29,7 +31,7 @@
|
||||
<div class="main-inner {{ block "main_inner_class" . }}{{ end }}">
|
||||
<!-- Submenu,Content,Comment -->
|
||||
{{- block "main" . }}{{- end }}
|
||||
{{- if .IsPage }}
|
||||
{{- if and .IsPage $commentEnable }}
|
||||
{{- partialCached "comments.html" . }}
|
||||
{{- end }}
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{- $pageCfg := dict
|
||||
"isHome" .IsHome
|
||||
"isPage" .IsPage
|
||||
"comments" (.Params.comments | default .Site.Params.comments.enable)
|
||||
"comments" (.Scratch.Get "isComment")
|
||||
"permalink" (.Page.Permalink | absURL)
|
||||
"path" (.Page.Permalink | path.Base)
|
||||
"title" .Page.Title
|
||||
|
@ -32,7 +32,7 @@
|
||||
{{ if .Site.Params.waline.pageView }}
|
||||
{{ partial "post/header_meta/views.html" . }}
|
||||
{{ end }}
|
||||
{{ if .Site.Params.waline.comment }}
|
||||
{{ if and (.Scratch.Get "isComment") .Site.Params.waline.comment }}
|
||||
{{ partial "post/header_meta/comments.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@ -43,7 +43,7 @@
|
||||
{{ partial "post/header_meta/words.html" . }}
|
||||
{{ partial "post/header_meta/readtime.html" . }}
|
||||
{{ partial "post/header_meta/views.html" . }}
|
||||
{{ if .Site.Params.waline.comment }}
|
||||
{{ if and (.Scratch.Get "isComment") .Site.Params.waline.comment }}
|
||||
{{ partial "post/header_meta/comments.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@ -1,7 +1,9 @@
|
||||
<div class="tool-buttons" >
|
||||
{{ if .Scratch.Get "isComment" }}
|
||||
<div id="goto-comments" class="button goto-comments" title="{{ T "ToolBtns.comment" }}">
|
||||
<i class="fas fa-comments"></i>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.footer.translate }}
|
||||
<div id="goto-gtranslate" class="button" title="{{ T "ToolBtns.lang" }}">
|
||||
<i class="fas fa-globe"></i>
|
||||
|
Loading…
Reference in New Issue
Block a user