From 8918bff71f77ee06be8db1c827feba4131994b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=A1=E6=A2=A6=E6=98=9F=E5=B0=98?= Date: Sun, 6 Nov 2022 18:23:55 +0800 Subject: [PATCH] :bug: Fixed the page views counter in home page. --- layouts/_default/baseof.html | 6 +++--- layouts/partials/post/header.html | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8db7191..a83b22c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,8 +1,8 @@ {{- range $k, $v := (partialCached "init.html" .) -}} {{- $.Scratch.Set $k $v -}} {{- end -}} -{{ $commentEnable := .Params.comment.enable | default .Site.Params.comments.enable }} -{{ .Scratch.Set "isComment" $commentEnable }} +{{ $isComment := .Params.comment.enable | default .Site.Params.comments.enable }} +{{ .Scratch.Set "isComment" $isComment }} @@ -31,7 +31,7 @@
{{- block "main" . }}{{- end }} - {{- if and .IsPage $commentEnable }} + {{- if and .IsPage $isComment }} {{- partialCached "comments.html" . }} {{- end }}
diff --git a/layouts/partials/post/header.html b/layouts/partials/post/header.html index b482c8e..2097a4f 100644 --- a/layouts/partials/post/header.html +++ b/layouts/partials/post/header.html @@ -22,6 +22,7 @@ {{- end }} {{- end }} {{- if $.IsHome }} {{ else }} {{ end -}} +{{ $isComment := and (.Scratch.Get "isComment") .Site.Params.waline.comment }}