summaryrefslogtreecommitdiff
path: root/src/components/blog/webmentions/index.astro
blob: 232b4f3df8991477107b11879e51d6ad322324dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
import { getWebmentionsForUrl } from "@/utils/webmentions";
import Comments from "./Comments.astro";
import Likes from "./Likes.astro";

const url = new URL(Astro.url.pathname, Astro.site);

const webMentions = await getWebmentionsForUrl(`${url}`);

// Return if no webmentions
if (!webMentions.length) return;
---

<hr class="border-solid" />
<h2 class="mb-8 before:hidden">Webmentions for this post</h2>
<div class="space-y-10">
	<Likes mentions={webMentions} />
	<Comments mentions={webMentions} />
</div>
<p class="mt-8">
	Responses powered by{" "}
	<a href="https://webmention.io" rel="noreferrer" target="_blank">Webmentions</a>
</p>