From bece9f6fa2656769944319a248cd12a184c7d9a2 Mon Sep 17 00:00:00 2001
From: Cell <1024@lruihao.cn>
Date: Fri, 22 Dec 2023 10:36:39 +0800
Subject: [PATCH] :zap: Perf: only show update date when update date not equal
publish date
---
layouts/posts/single.html | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/layouts/posts/single.html b/layouts/posts/single.html
index dbe0856b..1c717c51 100644
--- a/layouts/posts/single.html
+++ b/layouts/posts/single.html
@@ -48,11 +48,13 @@
{{- printf `` . . | safeHTML -}}
{{- end -}}
- {{- with .Lastmod | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
-
- {{- dict "Class" "fa-regular fa-edit fa-fw me-1" | partial "plugin/icon.html" -}}
- {{- printf `` . . | safeHTML -}}
-
+ {{- if ne .Lastmod.Unix .PublishDate.Unix }}
+ {{- with .Lastmod | dateFormat (.Site.Params.dateformat | default "2006-01-02") -}}
+
+ {{- dict "Class" "fa-regular fa-edit fa-fw me-1" | partial "plugin/icon.html" -}}
+ {{- printf `` . . | safeHTML -}}
+
+ {{- end -}}
{{- end -}}
{{- if $params.wordCount -}}