diff --git a/src/components/blogCard.astro b/src/components/blogCard.astro index 3f7549c..e4bc2ee 100644 --- a/src/components/blogCard.astro +++ b/src/components/blogCard.astro @@ -2,91 +2,57 @@ import dayjs from "dayjs"; import "dayjs/locale/es"; dayjs.locale("es"); -import readingTime from "reading-time"; -import categories from "../data/categories.json"; import { members_api_url } from "../data/conf.json"; -import { Image } from 'astro:assets'; +import { Image, type ImgAttributes } from 'astro:assets'; import { convertASCIICharsToText, convertMarkdownToPlainText } from "markdown-to-text-renderer"; -const { post, index } = Astro.props; +interface Props { + post: any; + imgLoading: ImgAttributes['loading']; +} + +const { post, imgLoading } = Astro.props; const response = await fetch(members_api_url + "/members/" + post.data.username); const user_data = await response.json(); -const stats = readingTime(post.body); -const read_time = stats.text.replace("read", ""); const description = post.data.description ? post.data.description : convertASCIICharsToText(convertMarkdownToPlainText(post.body.slice(0, 160))) + "..."; const display_date = dayjs(post.data.pubDate).format("D MMM. YYYY"); -let imgLoading = index === 0 || index === 1 ? "eager" : "lazy"; --- -
- - { - post.data.image && ( - {post.data.title - ) - } - - -
- + + { + post.data.image && ( + {post.data.title + ) + } - -
- {post.data.title} -
-
- -

- {description} -

-
-
-
- { - post.data.categories.map((category) => ( - - {"#" + categories[category].text} - - )) - } -
-
{read_time + " lectura"}
-
+
+

+ {post.data.title} +

+

+ {description} +

-
+ + + {user_data.name} + · + {display_date} + + + diff --git a/src/components/footer.astro b/src/components/footer.astro index b538904..7bd6cd2 100644 --- a/src/components/footer.astro +++ b/src/components/footer.astro @@ -6,10 +6,10 @@ import SearchBtnFooter from "./ui/searchBtnFooter.svelte"; ---