--- import Layout from "@/layouts/Layout.astro"; import { getCollection, render } from "astro:content"; import { type GetStaticPaths } from "astro"; interface Props { entry: any; } export const getStaticPaths: GetStaticPaths = async () => { const entries = await getCollection("blog"); return entries.map((entry: any) => ({ params: { id: entry.id }, props: { entry }, })); }; const { entry } = Astro.props; const { Content } = await render(entry); const formattedDate = new Date(entry.data.publishedAt).toLocaleDateString( "es-ES", { year: "numeric", month: "long", day: "numeric", weekday: "long", }, ); const schema = { "@context": "https://schema.org", "@type": "BlogPosting", headline: entry.data.title, datePublished: entry.data.publishedAt.toISOString(), keywords: entry.data.tags || [], author: { "@type": "Person", name: "Ariel Costas Guerrero", }, publisher: { "@type": "Person", name: "Ariel Costas Guerrero", url: "https://www.costas.dev", image: { "@type": "ImageObject", url: "https://www.costas.dev/favicon.png", }, }, }; const textToEncode = `${entry.data.title}\r\n\r\n${Astro.url.toString()} por @arielcg@mastodon.social`; const mastodonShareUrl = `https://share.joinmastodon.org/#text=${encodeURIComponent(textToEncode)}`; --- {entry.data.title} Publicado el {formattedDate} {entry.data.tags && entry.data.tags.length > 0 && ( <> • Etiquetas: {entry.data.tags.map((tag: string) => ( {tag} ))} > )} Volver al blog · Compartir en Mastodon
Volver al blog · Compartir en Mastodon