mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🐛 Fix: close comment system logic error when the article was expired
This commit is contained in:
@@ -50,6 +50,15 @@
|
||||
{{- end -}}
|
||||
<i class="fa-solid fa-pencil-alt fa-fw"></i> {{ T "wordCount" .WordCount }}
|
||||
<i class="fa-regular fa-clock fa-fw"></i> {{ T "readingTime" .ReadingTime }}
|
||||
|
||||
{{- /* If the article expires, close the comment or not */ -}}
|
||||
{{- $expirationReminder := $params.expirationReminder | default dict -}}
|
||||
{{- if
|
||||
$expirationReminder.enable
|
||||
| and (gt (div (sub now.Unix .Lastmod.Unix) 86400) ($expirationReminder.warning | default 180))
|
||||
| and $expirationReminder.closeComment -}}
|
||||
{{- .Scratch.Set "comment" (dict "enable" false) -}}
|
||||
{{- end -}}
|
||||
{{- $comment := .Scratch.Get "comment" | default dict -}}
|
||||
{{- /* Visitor Count */ -}}
|
||||
{{- if $comment.enable -}}
|
||||
|
||||
Reference in New Issue
Block a user