From 6cb688bd1b2285fb917194852fdc285c798d43cc Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Sat, 7 Jun 2025 20:17:01 +0200 Subject: Add new images and update portfolio layouts for enhanced presentation --- src/layouts/BlogSingleLayout.astro | 134 +++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 src/layouts/BlogSingleLayout.astro (limited to 'src/layouts/BlogSingleLayout.astro') diff --git a/src/layouts/BlogSingleLayout.astro b/src/layouts/BlogSingleLayout.astro new file mode 100644 index 0000000..0c3b934 --- /dev/null +++ b/src/layouts/BlogSingleLayout.astro @@ -0,0 +1,134 @@ +--- +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", + }, + }, +}; +--- + + +