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:
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
|
||||
- :sparkles: Feat(SEO): add options to make output baidu_urls.txt file ([#138](https://github.com/Lruihao/FixIt/issues/138))
|
||||
- :bug: Fix: Giscus comments invalid config `inputPosition`
|
||||
- :bug: Fix: busuanzi logic error
|
||||
- :bug: Fix: close comment system logic error when the article was expired
|
||||
- :art: Style: add scroll bar for auto toc ([#136](https://github.com/Lruihao/FixIt/issues/136))
|
||||
- :arrow_up: Chore: update some third-party libraries
|
||||
- **Full Changelog:** @Lruihao [`v0.2.14...v0.2.15`](https://github.com/Lruihao/FixIt/compare/v0.2.14...v0.2.15)
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
{{- if gt $daysAgo $warningThreshold -}}
|
||||
{{- $type = "warning" -}}
|
||||
{{- $icon = "fa-exclamation-triangle" -}}
|
||||
{{- /* If the article expires, close the comment or not */ -}}
|
||||
{{- if $expirationReminder.closeComment -}}
|
||||
{{- .Scratch.Set "comment" dict -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
<div class="details admonition {{ $type }} open">
|
||||
<div class="details-summary admonition-title">
|
||||
|
||||
@@ -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