diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 51c3763..5268de8 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -7,6 +7,7 @@ const { description = "", image = null, url = null, + date = null, } = Astro.props; const imageUrl = image ? new URL(image, Astro.site).toString() : null; @@ -35,6 +36,8 @@ const imageUrl = image ? new URL(image, Astro.site).toString() : null; + {date && } + diff --git a/src/components/ShareSticky.vue b/src/components/ShareSticky.vue index c6a3923..76c69b4 100644 --- a/src/components/ShareSticky.vue +++ b/src/components/ShareSticky.vue @@ -15,27 +15,27 @@ diff --git a/src/components/section/TitleSection.astro b/src/components/section/TitleSection.astro index 55c4332..8ff693d 100644 --- a/src/components/section/TitleSection.astro +++ b/src/components/section/TitleSection.astro @@ -6,7 +6,7 @@ const { title } = Astro.props;
-

{title}

+

{title}

Leon
diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro index c3cd7ec..c1d7d4b 100644 --- a/src/layouts/MainLayout.astro +++ b/src/layouts/MainLayout.astro @@ -13,7 +13,8 @@ const { title, description, image, - url + url, + date } = Astro.props; const currentLocale = Astro.currentLocale ?? 'es'; @@ -29,6 +30,7 @@ const isNewsPage = newsSegments.some(segment => Astro.url.pathname.includes(`/${ description={description} image={image} url={url} + date={date} />
@@ -78,14 +105,21 @@ const excerpt = words.join(" ") + (words.length === 35 ? "..." : ""); }
-
+
- - +
+ + +
{post.data.youtube && } diff --git a/src/pages/[news_slug]/[id].astro b/src/pages/[news_slug]/[id].astro index ba3ae7b..994321c 100644 --- a/src/pages/[news_slug]/[id].astro +++ b/src/pages/[news_slug]/[id].astro @@ -29,6 +29,8 @@ const baseUrl = Astro.site ?? "https://mk8nrc8p-4321.brs.devtunnels.ms"; const pageUrl = new URL(`/${post.data.locale}/${news_slug}/${post.id}`, baseUrl).toString(); +const imageUrl = post.data.thumbnail ? new URL(post.data.thumbnail, baseUrl).toString() : null; +const localeDate = new Intl.DateTimeFormat(post.data.locale || 'es', { year: 'numeric', month: 'long', day: 'numeric' }).format(post.data.date); --- @@ -39,7 +41,10 @@ const pageUrl = new URL(`/${post.data.locale}/${news_slug}/${post.id}`, baseUrl) } - + {post.data.title} @@ -60,18 +65,37 @@ const pageUrl = new URL(`/${post.data.locale}/${news_slug}/${post.id}`, baseUrl) )} + +