From f14c48001b23feadabb8e4d4e5cff74f43fe9d9f Mon Sep 17 00:00:00 2001 From: eltrac Date: Mon, 23 Mar 2026 14:52:24 +0800 Subject: fix(webmention): avoid parsing time string that is already formatted --- layouts/_partials/posts/webmention-replies.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'layouts/_partials/posts') 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) }}

- {{ $t := time.AsTime (index $reply.published 0) }} -

+ {{ $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 }} +

-- cgit v1.2.3