summaryrefslogtreecommitdiff
path: root/layouts/_partials/posts
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-03-23 14:52:24 +0800
committereltrac <hi@eltr.ac>2026-03-23 14:52:24 +0800
commitf14c48001b23feadabb8e4d4e5cff74f43fe9d9f (patch)
tree4b04c0b3fccb6521339b87025724d60a9393b066 /layouts/_partials/posts
parent2073e16fcc16696cea5a02e5aab71719c133c718 (diff)
fix(webmention): avoid parsing time string that is already formatted
Diffstat (limited to 'layouts/_partials/posts')
-rw-r--r--layouts/_partials/posts/webmention-replies.html9
1 files changed, 7 insertions, 2 deletions
diff --git a/layouts/_partials/posts/webmention-replies.html b/layouts/_partials/posts/webmention-replies.html
index 19e6a352..42f24579 100644
--- a/layouts/_partials/posts/webmention-replies.html
+++ b/layouts/_partials/posts/webmention-replies.html
@@ -18,8 +18,13 @@
{{ replaceRE ":.*?:" "" (index $author.name 0) }}
</a>
</p>
- {{ $t := time.AsTime (index $reply.published 0) }}
- <p class="m-0"><time>{{ time.Format "2006-1-2 15:04" $t}}</time></p>
+ {{ $time := (index $reply.published 0) }}
+ {{ $isFormated := strings.Contains $time " " }}
+ {{ if not $isFormated }}
+ {{ $t := time.AsTime $time }}
+ {{ $time = time.Format "2006-1-2 15:04" $t }}
+ {{ end }}
+ <p class="m-0"><time>{{ $time }}</time></p>
</div>
</div>
<div class="flex items-start">