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/Masthead.astro | 7 +- src/components/blog/webmentions/Comments.astro | 90 -------------------------- src/components/blog/webmentions/Likes.astro | 54 ---------------- src/components/blog/webmentions/index.astro | 29 --------- 4 files changed, 1 insertion(+), 179 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') diff --git a/src/components/blog/Masthead.astro b/src/components/blog/Masthead.astro index e7b3ea9..7a50d8a 100644 --- a/src/components/blog/Masthead.astro +++ b/src/components/blog/Masthead.astro @@ -6,13 +6,11 @@ import { t } from "@/i18n/translations"; interface Props { content: CollectionEntry<"post">; - readingTime: string; language?: string | undefined; } const { content: { data }, - readingTime, language, } = Astro.props; @@ -41,10 +39,7 @@ const dateTimeOptions: Intl.DateTimeFormatOptions = {

- /{ - " " - } - {readingTime} +

{ data.updatedDate && ( 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")} -

-
    - {comments.map((mention) => ( -
  • - {mention.author?.photo && mention.author.photo !== "" ? ( - mention.author.url && mention.author.url !== "" ? ( - - {mention.author?.name} - - ) : ( - {mention.author?.name} - ) - ) : null} -
    - -

    - {mention.content?.text} -

    -
    -
  • - ))} -
-
- ) -} 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 && ( -
    - {likesToShow.map((like) => ( -
  • - - - {like.author!.name} - - -
  • - ))} -
- )} -
- ) -} 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