From 36c383a0527d60dfc49e01651c620692101a23cd Mon Sep 17 00:00:00 2001 From: Esteban Date: Sun, 10 May 2026 11:06:52 -0500 Subject: [PATCH] feat: initialize TinaCMS configuration with news and documentaries collections --- src/pages/[news_slug]/[id].astro | 120 ------------------- src/pages/[news_slug]/index.astro | 60 ---------- src/pages/archive/documents/[document].astro | 19 --- src/pages/archive/documents/index.astro | 19 --- src/pages/archive/index.astro | 19 --- src/pages/nations/[nation].astro | 19 --- src/pages/nations/index.astro | 19 --- tina/__generated__/_graphql.json | 2 +- tina/__generated__/_schema.json | 2 +- tina/__generated__/config.prebuild.jsx | 45 ++++++- tina/__generated__/frags.gql | 8 +- tina/__generated__/schema.gql | 38 +++++- tina/__generated__/types.ts | 53 ++++++-- tina/config.ts | 45 ++++++- tina/tina-lock.json | 2 +- 15 files changed, 167 insertions(+), 303 deletions(-) delete mode 100644 src/pages/[news_slug]/[id].astro delete mode 100644 src/pages/[news_slug]/index.astro delete mode 100644 src/pages/archive/documents/[document].astro delete mode 100644 src/pages/archive/documents/index.astro delete mode 100644 src/pages/archive/index.astro delete mode 100644 src/pages/nations/[nation].astro delete mode 100644 src/pages/nations/index.astro diff --git a/src/pages/[news_slug]/[id].astro b/src/pages/[news_slug]/[id].astro deleted file mode 100644 index 821247f..0000000 --- a/src/pages/[news_slug]/[id].astro +++ /dev/null @@ -1,120 +0,0 @@ ---- -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); -const y = post.data.date.getFullYear(); -const m = String(post.data.date.getMonth() + 1).padStart(2, '0'); -const d = String(post.data.date.getDate()).padStart(2, '0'); -const dateISO = `${y}-${m}-${d}`; ---- - - - - - - - - {post.data.title} - - - - - - - - - - {post.data.gallery && post.data.gallery.length > 0 && post.data.gallery[0].image && ( - <> - - - - - - )} - - -