--- import { YouTube } from 'astro-embed'; import MainLayout from "../../layouts/MainLayout.astro"; import Header from "../../components/Header.astro"; import CarouselSection from "../../components/section/CarouselSection.astro"; import { Image } from "@unpic/astro"; import { getCollection, render } from "astro:content"; import TitleSection from "../../components/section/TitleSection.astro"; import FooterSection from '../../components/section/FooterSection.astro'; import { getLocalizedRoute } from '@/i18n'; export const prerender = true; // 1. Generate a new path for every collection entry export async function getStaticPaths() { const posts = await getCollection("news"); return posts.map((post) => ({ params: { id: post.id, news_slug: getLocalizedRoute('news', post.data.locale) }, props: { post }, })); } const { news_slug } = Astro.params; const { post } = Astro.props; const { Content } = await render(post); console.log("astro site", Astro.site); 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); --- {post.data.title} {post.data.gallery && post.data.gallery.length > 0 && post.data.gallery[0].image && ( <> )}