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"; --- -
- {description} -
- -+ {description} +