From b6e440699e9fca474869bf74ce09f2310f05c620 Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 13 Jan 2026 20:06:15 +0100 Subject: Cleanup unused functionalities --- src/components/blog/webmentions/Comments.astro | 90 -------------------------- src/components/blog/webmentions/Likes.astro | 54 ---------------- src/components/blog/webmentions/index.astro | 29 --------- 3 files changed, 173 deletions(-) delete mode 100644 src/components/blog/webmentions/Comments.astro delete mode 100644 src/components/blog/webmentions/Likes.astro delete mode 100644 src/components/blog/webmentions/index.astro (limited to 'src/components/blog/webmentions') diff --git a/src/components/blog/webmentions/Comments.astro b/src/components/blog/webmentions/Comments.astro deleted file mode 100644 index 9d274f9..0000000 --- a/src/components/blog/webmentions/Comments.astro +++ /dev/null @@ -1,90 +0,0 @@ ---- -import { Image } from "astro:assets"; -import { Icon } from "astro-icon/components"; -import { t } from "@/i18n/translations"; -import type { WebmentionsChildren } from "@/types"; - -interface Props { - mentions: WebmentionsChildren[]; - language?: string | undefined; -} - -const { mentions, language } = Astro.props; - -const validComments = ["mention-of", "in-reply-to"]; - -const comments = mentions.filter( - (mention) => validComments.includes(mention["wm-property"]) && mention.content?.text, -); ---- - -{ - !!comments.length && ( -
-

- {comments.length}{" "} - {comments.length > 1 ? t(language, "mentions") : t(language, "mention")} -

- -
- ) -} diff --git a/src/components/blog/webmentions/Likes.astro b/src/components/blog/webmentions/Likes.astro deleted file mode 100644 index fce1a96..0000000 --- a/src/components/blog/webmentions/Likes.astro +++ /dev/null @@ -1,54 +0,0 @@ ---- -import { Image } from "astro:assets"; -import { t } from "@/i18n/translations"; -import type { WebmentionsChildren } from "@/types"; - -interface Props { - mentions: WebmentionsChildren[]; - language?: string | undefined; -} - -const { mentions, language } = Astro.props; -const MAX_LIKES = 10; - -const likes = mentions.filter((mention) => mention["wm-property"] === "like-of"); -const likesToShow = likes - .filter((like) => like.author?.photo && like.author.photo !== "") - .slice(0, MAX_LIKES); ---- - -{ - !!likes.length && ( -
-

- {likes.length}{" "} - {likes.length > 1 ? t(language, "peopleLiked") : t(language, "personLiked")} -

- {!!likesToShow.length && ( - - )} -
- ) -} diff --git a/src/components/blog/webmentions/index.astro b/src/components/blog/webmentions/index.astro deleted file mode 100644 index 80376f0..0000000 --- a/src/components/blog/webmentions/index.astro +++ /dev/null @@ -1,29 +0,0 @@ ---- -import { t } from "@/i18n/translations"; -import { getWebmentionsForUrl } from "@/utils/webmentions"; -import Comments from "./Comments.astro"; -import Likes from "./Likes.astro"; - -interface Props { - language?: string | undefined; -} - -const { language } = Astro.props; -const url = new URL(Astro.url.pathname, Astro.site); - -const webMentions = await getWebmentionsForUrl(`${url}`); - -// Return if no webmentions -if (!webMentions.length) return; ---- - -
-

{t(language, "webmentionsTitle")}

-
- - -
-

- {t(language, "responsesPoweredBy")}{" "} - Webmentions -

-- cgit v1.2.3