From 3b8b35ce8c974e30222725c3626e02966c3ec60d Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Fri, 27 May 2022 19:21:43 -0700 Subject: [PATCH] Fix: get webmentions from legacy URLs --- layouts/partials/webmentions.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/partials/webmentions.html b/layouts/partials/webmentions.html index dcb0d2c..02e4c81 100644 --- a/layouts/partials/webmentions.html +++ b/layouts/partials/webmentions.html @@ -3,8 +3,10 @@

This site supports Webmentions. Webmentions received for this post will appear in the following list after I approve them. I sometimes send Webmentions to myself on behalf of linking sites that don't support them. Check the Wayback Machine if any links are broken.

{{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }} - {{ $url := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}} - {{ $webmentions := getJSON $url -}} + {{- $oldTarget := $target | replaceRE "/posts" "" | replaceRE "/$" ".html" -}} + {{ $url1 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}} + {{ $url2 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $oldTarget -}} + {{ $webmentions := (getJSON $url1) | append (getJSON $url2) -}} {{ range $webmentions -}} {{ $webmention := . -}} {{ if (eq $webmention.type "like") -}}