diff options
| -rw-r--r-- | layouts/_partials/posts/action-menu.html | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/layouts/_partials/posts/action-menu.html b/layouts/_partials/posts/action-menu.html index fdb45596..869996b9 100644 --- a/layouts/_partials/posts/action-menu.html +++ b/layouts/_partials/posts/action-menu.html @@ -2,14 +2,11 @@ {{ $webmentions := slice }} {{ range .Site.Data.webmentions }} - {{/* 1. 解析数据中的绝对 URL */}} {{ $urlObj := urls.Parse .webmention.target }} - - {{/* 2. 获取其路径部分(例如 /posts/hello-world/) */}} {{ $targetPath := $urlObj.Path }} - {{/* 3. 对比:考虑原始路径和编码后的路径 */}} - {{ if or (eq $targetPath $currentPagePath) (eq $targetPath ($currentPagePath | urlquery)) }} + {{ if or (strings.Contains $targetPath $currentPagePath) + (strings.Contains $targetPath ($currentPagePath | urlquery)) }} {{ $webmentions = $webmentions | append . }} {{ end }} {{ end }} |
