Merge pull request 'createEditorial' (#23) from createEditorial into main

Reviewed-on: #23
This commit is contained in:
Esteban Paz 2026-06-30 19:51:44 +00:00
commit 8b77ff0f77
33 changed files with 855 additions and 149 deletions

View File

@ -6,6 +6,7 @@ import { getCollection } from "astro:content";
import { createTranslator, routeTranslations } from "../i18n/index.ts"; import { createTranslator, routeTranslations } from "../i18n/index.ts";
const allNews = await getCollection("news"); const allNews = await getCollection("news");
const allEditorial = await getCollection("editorial");
const tl = createTranslator(Astro.currentLocale); const tl = createTranslator(Astro.currentLocale);
const currentLocale = Astro.currentLocale; const currentLocale = Astro.currentLocale;
@ -27,6 +28,7 @@ const navItems = [
{ href: "#somos", key: "nav.about" }, { href: "#somos", key: "nav.about" },
{ href: "#programs", key: "nav.programs" }, { href: "#programs", key: "nav.programs" },
{ href: "#news", key: "nav.news" }, { href: "#news", key: "nav.news" },
{ href: "#editorial", key: "nav.editorial" },
]; ];
const sidebarNavItems = [ const sidebarNavItems = [
@ -34,13 +36,14 @@ const sidebarNavItems = [
{ href: "#somos", key: "nav.about" }, { href: "#somos", key: "nav.about" },
{ href: "#programs", key: "nav.programs" }, { href: "#programs", key: "nav.programs" },
{ href: "#news", key: "nav.news" }, { href: "#news", key: "nav.news" },
{ href: "#editorial", key: "nav.editorial" },
]; ];
function translatePath(newLocale: string) { function translatePath(newLocale: string) {
const segments = currentPath.split("/").filter(Boolean); const segments = currentPath.split("/").filter(Boolean);
if (segments.length === 0) return `/${newLocale}`; if (segments.length === 0) return `/${newLocale}`;
const remainingSegments = segments.slice(1); const remainingSegments = segments.slice(1);
const newsRouteNames = Object.values(routeTranslations.news); const allRouteNames = Object.values(routeTranslations).flatMap(r => Object.values(r));
const translatedSegments = remainingSegments.map((segment) => { const translatedSegments = remainingSegments.map((segment) => {
for (const key in routeTranslations) { for (const key in routeTranslations) {
const translations = const translations =
@ -54,15 +57,19 @@ function translatePath(newLocale: string) {
} }
return segment; return segment;
}); });
if (segments.length >= 2 && newsRouteNames.includes(segments[1])) { if (segments.length >= 2 && allRouteNames.includes(segments[1])) {
if (segments.length >= 3) { if (segments.length >= 3) {
const currentId = segments[segments.length - 1]; const currentId = segments[segments.length - 1];
const baseId = currentId.split("/").pop(); const baseId = currentId.split("/").pop();
const exists = allNews.some( const existsInNews = allNews.some(
(post) => (post) =>
post.id.endsWith(baseId!) && post.data.locale === newLocale, post.id.endsWith(baseId!) && post.data.locale === newLocale,
); );
if (!exists) return `/${newLocale}/${translatedSegments[0]}`; const existsInEditorial = allEditorial.some(
(post) =>
post.id.endsWith(baseId!) && post.data.locale === newLocale,
);
if (!existsInNews && !existsInEditorial) return `/${newLocale}/${translatedSegments[0]}`;
return `/${newLocale}/${translatedSegments[0]}/${newLocale}/${baseId}`; return `/${newLocale}/${translatedSegments[0]}/${newLocale}/${baseId}`;
} }
} }

View File

@ -18,7 +18,7 @@ const regionNames = new Intl.DisplayNames([locale], { type: 'region' });
dayjs.extend(utc); dayjs.extend(utc);
dayjs.locale(locale); dayjs.locale(locale);
const { data } = Astro.props; const { data, routeKey = "news" } = Astro.props;
const nicedate = dayjs.utc(data.data.date).format("D MMMM YYYY"); const nicedate = dayjs.utc(data.data.date).format("D MMMM YYYY");
const countryName = data?.data?.country ? regionNames.of(data.data.country) : ""; const countryName = data?.data?.country ? regionNames.of(data.data.country) : "";
@ -32,10 +32,10 @@ locationArray.filter(Boolean).join(', ');
{locationArray.filter(Boolean).join(', ')}<br /> {locationArray.filter(Boolean).join(', ')}<br />
({nicedate}): ({nicedate}):
</p> </p>
<h3 class="md:text-2xl text-lg mb-4 font-bold md:mb-8 hover:underline"><a href={`/${locale}/${getLocalizedRoute('news', locale)}/${data.id}`}>{data.data.title}</a></h3> <h3 class="md:text-2xl text-lg mb-4 font-bold md:mb-8 hover:underline"><a href={`/${locale}/${getLocalizedRoute(routeKey, locale)}/${data.id}`}>{data.data.title}</a></h3>
<div class="overflow-hidden"> <div class="overflow-hidden">
<a href={`/${locale}/${getLocalizedRoute('news', locale)}/${data.id}`}> <a href={`/${locale}/${getLocalizedRoute(routeKey, locale)}/${data.id}`}>
<Image <Image
src={data.data.thumbnail} src={data.data.thumbnail}
alt={data.data.title} alt={data.data.title}
@ -45,8 +45,8 @@ locationArray.filter(Boolean).join(', ');
</div> </div>
<div class="mt-8"> <div class="mt-8">
<a href={`/${locale}/${getLocalizedRoute('news', locale)}/${data.id}`} class="inline-flex items-center gap-2 px-6 py-3 bg-white text-[#22523F] hover:bg-[#22523F] hover:text-[#EBE6D2] hover:underline font-bold transition text-sm rounded-none uppercase"> <a href={`/${locale}/${getLocalizedRoute(routeKey, locale)}/${data.id}`} class="inline-flex items-center gap-2 px-6 py-3 bg-white text-[#22523F] hover:bg-[#22523F] hover:text-[#EBE6D2] hover:underline font-bold transition text-sm rounded-none uppercase">
{tl("news.fullnew")} {tl(routeKey + ".fullnew")}
<Icon name="ph:arrow-right" class="transform group-hover:translate-x-1 transition-transform" /> <Icon name="ph:arrow-right" class="transform group-hover:translate-x-1 transition-transform" />
</a> </a>
</div> </div>

View File

@ -19,13 +19,13 @@ const tl = createTranslator(locale);
dayjs.extend(utc); dayjs.extend(utc);
dayjs.locale(locale); dayjs.locale(locale);
const { data, content } = Astro.props; const { data, content, routeKey = "news" } = Astro.props;
const nicedate = dayjs.utc(data.data.date).format("D MMMM YYYY"); const nicedate = dayjs.utc(data.data.date).format("D MMMM YYYY");
const countryName = data?.data?.country ? regionNames.of(data.data.country) : ""; const countryName = data?.data?.country ? regionNames.of(data.data.country) : "";
const location = [data.data.city, data.data.state, countryName].filter(Boolean).join(", "); const location = [data.data.city, data.data.state, countryName].filter(Boolean).join(", ");
const newsUrl = `/${locale}/${getLocalizedRoute("news", locale)}/${data.id}`; const newsUrl = `/${locale}/${getLocalizedRoute(routeKey, locale)}/${data.id}`;
const rawContent = content?.body || ""; const rawContent = content?.body || "";
const plainText = rawContent.replace(/^#.*$/gm, "").replace(/^###.*$/gm, "").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/_([^_]+)_/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/^>.*$/gm, "").replace(/`[^`]+`/g, "").replace(/^[-*]\s+/gm, "").trim(); const plainText = rawContent.replace(/^#.*$/gm, "").replace(/^###.*$/gm, "").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/_([^_]+)_/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/^>.*$/gm, "").replace(/`[^`]+`/g, "").replace(/^[-*]\s+/gm, "").trim();
@ -59,7 +59,7 @@ const excerpt = words.join(" ") + (words.length === 40 ? "..." : "");
<div class="mt-auto"> <div class="mt-auto">
<span class="inline-flex items-center gap-1 text-sm font-primary text-tertiary font-semibold group-hover:underline"> <span class="inline-flex items-center gap-1 text-sm font-primary text-tertiary font-semibold group-hover:underline">
{tl("news.seemore")} {tl(routeKey + ".seemore")}
<Icon name="ph:arrow-right" class="transform group-hover:translate-x-1 transition-transform" /> <Icon name="ph:arrow-right" class="transform group-hover:translate-x-1 transition-transform" />
</span> </span>
</div> </div>

View File

@ -0,0 +1,63 @@
---
import { getCollection } from "astro:content";
import { Image } from "@unpic/astro";
import Button from "../ui/Button.astro";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import { createTranslator, getLocalizedRoute } from '../../i18n';
const currentLocale = Astro.currentLocale;
const tl = createTranslator(currentLocale);
const items = await getCollection("editorial", (post)=>{
return post.data.locale == currentLocale
});
const sorted = [...items]
.sort((a, b) => {
const dateDiff = new Date(b.data.date).getTime() - new Date(a.data.date).getTime()
if (dateDiff !== 0) return dateDiff
return (a.data.order ?? 0) - (b.data.order ?? 0)
})
.slice(0, 6);
dayjs.extend(utc);
dayjs.locale(currentLocale || "es");
---
<div id="editorial" class="bg-[#EBE5D0] py-10 lg:py-14">
<div class="container mx-auto px-4 md:px-0 max-w-4xl">
<div class="flex flex-col items-center mb-8">
<h4 class="text-[#003421] text-2xl uppercase font-bold text-center font-primary">{tl("editorial.title")}</h4>
<h2 class="text-[#003421] text-3xl md:text-4xl font-bold text-center font-secondary mt-1">{tl("editorial.text")}</h2>
</div>
<div class="divide-y divide-[#003421]/10">
{
sorted.map((item) => {
const date = dayjs.utc(item.data.date).format("D MMMM YYYY");
const url = `/${currentLocale}/${getLocalizedRoute("editorial", currentLocale)}/${item.id}`;
const thumb = item.data.thumbnail_square || item.data.thumbnail;
return (
<a href={url} class="flex gap-5 py-5 group hover:bg-[#003421]/5 transition-colors -mx-3 px-3 rounded-sm">
<div class="w-20 h-20 md:w-24 md:h-24 shrink-0 overflow-hidden rounded-sm bg-[#003421]/10">
{thumb && (
<Image src={thumb} alt={item.data.title} class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300" />
)}
</div>
<div class="min-w-0 flex-1">
<p class="text-sm md:text-base font-primary font-semibold text-[#22523F]">Dr. José Benjamín Pérez Matos</p>
<p class="text-sm text-[#003421]/50 font-primary mt-0.5">{date}</p>
<h3 class="text-base md:text-lg font-secondary font-bold text-[#003421] group-hover:text-[#003421]/60 transition-colors mt-1 leading-snug line-clamp-2">{item.data.title}</h3>
</div>
</a>
)
})
}
</div>
<div class="flex justify-center mt-8">
<Button class="px-6 py-2.5 uppercase text-sm" url={`/${currentLocale}/${getLocalizedRoute('editorial', currentLocale)}`} variant="primary" title={tl("editorial.buttonLable")} />
</div>
</div>
</div>

View File

@ -1,30 +1,30 @@
--- ---
import { getCollection, getEntry } from "astro:content"; import { getCollection } from "astro:content";
import NewsCard from "../cards/NewsCard.astro"; import NewsCard from "../cards/NewsCard.astro";
import Button from "../ui/Button.astro"; import Button from "../ui/Button.astro";
const { props } = Astro.props;
const { routeKey = "news", anchorId = "news", titlePrefix = "news" } = Astro.props;
const currentLocale = Astro.currentLocale; const currentLocale = Astro.currentLocale;
const newsItems = await getCollection("news", (post)=>{ const items = await getCollection(routeKey, (post)=>{
const currentLocale = Astro.currentLocale;
return post.data.locale == currentLocale return post.data.locale == currentLocale
}); });
import { createTranslator, getLocalizedRoute } from '../../i18n'; import { createTranslator, getLocalizedRoute } from '../../i18n';
const tl = createTranslator(Astro.currentLocale); const tl = createTranslator(Astro.currentLocale);
--- ---
<div id="news" class="bg-[#22523F] py-12 lg:py-20"> <div id={anchorId} class="bg-[#22523F] py-12 lg:py-20">
<div class="container mx-auto"> <div class="container mx-auto">
<div class="flex flex-col lg:w-1/2 items-center mx-auto py-8"> <div class="flex flex-col lg:w-1/2 items-center mx-auto py-8">
<h4 class="text-white text-2xl uppercase font-bold text-center mb-4 font-primary">{tl("news.title")}</h4> <h4 class="text-white text-2xl uppercase font-bold text-center mb-4 font-primary">{tl(titlePrefix + ".title")}</h4>
<h2 class="text-white text-3xl lg:text-5xl font-bold text-center font-secondary mb-4">{tl("news.text")}</h2> <h2 class="text-white text-3xl lg:text-5xl font-bold text-center font-secondary mb-4">{tl(titlePrefix + ".text")}</h2>
<p class="text-white text-xl text-center">{tl("news.text2")}</p> <p class="text-white text-xl text-center">{tl(titlePrefix + ".text2")}</p>
<Button class="px-6 py-3 uppercase mt-4" url={`/${currentLocale}/${getLocalizedRoute('news', currentLocale)}`} variant="primary" title={tl("news.buttonLable")} /> <Button class="px-6 py-3 uppercase mt-4" url={`/${currentLocale}/${getLocalizedRoute(routeKey, currentLocale)}`} variant="primary" title={tl(titlePrefix + ".buttonLable")} />
</div> </div>
<div class="grid md:grid-cols-2 lg:grid-cols-3 md:gap-10 gap-20"> <div class="grid md:grid-cols-2 lg:grid-cols-3 md:gap-10 gap-20">
{ {
[...newsItems] [...items]
.sort((a, b) => { .sort((a, b) => {
const dateDiff = const dateDiff =
new Date(b.data.date).getTime() - new Date(a.data.date).getTime() new Date(b.data.date).getTime() - new Date(a.data.date).getTime()
@ -35,7 +35,7 @@ const tl = createTranslator(Astro.currentLocale);
}) })
.slice(0,6) .slice(0,6)
.map((item) => ( .map((item) => (
<NewsCard data={item} /> <NewsCard data={item} routeKey={routeKey} />
)) ))
} }
</div> </div>

View File

@ -26,4 +26,28 @@ const news = defineCollection({
}), }),
}); });
export const collections = { news }; const editorial = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/editorial" }),
schema: ({ image }) => z.object({
locale: z.string().describe("Editorial main language"),
title: z.string(),
date: z.date(),
draft: z.boolean().optional(),
place: z.string().optional(),
order: z.number().optional(),
city: z.string().optional(),
state: z.string().optional(),
country: z.string().optional(),
thumbnail: image().optional().describe("Main editorial thumbnail image"),
thumbnail_square: image().optional().describe("Main editorial thumbnail square image"),
youtube: z.string().optional(),
tags: z.array(z.string()).optional().describe("Editorial tags"),
gallery: z.array(z.object({
image: image().optional(),
text: z.string().optional(),
text_alt: z.string().optional(),
})).optional().nullable()
}),
});
export const collections = { news, editorial };

View File

@ -1,7 +0,0 @@
---
locale: es
title: test
---
# test

View File

@ -0,0 +1,43 @@
---
locale: es
title: 'La verdadera naturaleza de las ideas'
date: 2026-06-30
order: 1
# city: 'Palmira'
# country: 'CO'
# state: 'Valle del Cauca'
slug: 2026-06-30-la-verdadera-naturaleza-de-las-ideas
thumbnail: 'https://ik.imagekit.io/crpy/tr:w-1280,q-100/comunicado-1.webp'
# tags: [Comunicado, Venezuela, Estados Unidos]
gallery: [
{
image: 'https://ik.imagekit.io/crpy/tr:w-1280,h-900,cm-pad_resize,bg-blurred,q-70/comunicado-1.webp',
},
]
---
# La verdadera naturaleza de las ideas
Las campañas electorales suelen estar cargadas de promesas, consignas y discursos cuidadosamente elaborados para conquistar el voto ciudadano. Sin embargo, una vez finalizada la contienda política, llega el momento en que las ideas abandonan el plano teórico y comienzan a manifestarse en la realidad. Sostengo firmemente que es precisamente en ese momento cuando resulta posible conocer la verdadera naturaleza de una ideología: no por lo que promete, sino por la conducta que inspira en sus dirigentes, en sus militantes y en quienes actúan en su nombre.
Las ideologías no deben ser juzgadas por la belleza de sus discursos, sino por sus resultados concretos.
Desde esta perspectiva, uno de los indicadores más claros consiste en observar cómo reaccionan los distintos sectores políticos cuando pierden el poder o cuando el resultado de una elección les resulta adverso. En diversos países de América Latina —como Chile, Bolivia, Honduras y Ecuador— se advierte un fenómeno que se repite con frecuencia: cuando un gobierno de izquierda es reemplazado por uno de derecha, la respuesta no es la aceptación institucional, sino la agitación, los disturbios y las acciones destinadas a alterar el orden público. En contraste, cuando los resultados electorales favorecen a la izquierda, la normalidad prevalece. La derecha, en su gran mayoría, asume los resultados y respeta el orden sin recurrir a la violencia como instrumento de presión política; los pocos desmanes aislados provienen de individuos torpes o de provocadores infiltrados para generar desestabilización.
Esta profunda diferencia y asimetría moral se manifiesta con total claridad en la seguridad de los líderes durante las contiendas políticas.
Recuerdo perfectamente las duras críticas hacia el presidente de Colombia por asistir a sus mítines rodeado de estrictas medidas de protección y blindajes, utilizándolo para presentarlo como alguien temeroso. Sin embargo, ese dirigente debía proteger su vida porque existían amenazas concretas de muerte en su contra. Por el contrario, el candidato de izquierda caminaba libremente y sin temores. La explicación es de pura lógica: sus seguidores jamás atentarían contra su propio líder, y los sectores de derecha no somos asesinos ni utilizamos la eliminación física del adversario como herramienta de acción política. Es en esa necesidad de protección donde se evidencia de qué lado se encuentra la inclinación hacia el daño y el mal.
No se trata de generalizar de forma absoluta; reconozco que no todos quienes se identifican con la izquierda participan de esas conductas. Muchos ciudadanos apoyan estos movimientos de buena fe, convencidos de que representan un camino hacia una sociedad más justa. Sin embargo, marchan engañados por planteamientos ideológicos que prometen justicia social, pero cuyas consecuencias reales ignoran por completo.
Los espejos de la región son dolorosos, evidentes y no admiten discusión.
Cuba, que en su momento fue una de las islas más prósperas y adelantadas del continente, hoy se hunde en un profundo deterioro económico y social, careciendo incluso de servicios básicos, como el suministro de energía eléctrica.
El mismo libreto de destrucción institucional y económica lo han seguido Nicaragua y Venezuela.
Esta última nación se encuentra hoy en una transición crucial; y mi deseo ferviente es que este proceso culmine plenamente para que el pueblo venezolano rompa sus cadenas, recupere sus instituciones democráticas y vuelva a vivir en absoluta y total libertad.
La historia reciente ofrece ejemplos suficientes para evaluar cada modelo; por ello, reafirmo mi convicción de que la defensa de la libertad, el Estado de Derecho y la convivencia pacífica son los pilares indispensables para construir sociedades verdaderamente prósperas.
**Dr. José Benjamín Pérez Matos**<br>
Presidente<br>

View File

@ -4,6 +4,7 @@
"nav.home": "Home", "nav.home": "Home",
"nav.about": "About", "nav.about": "About",
"nav.news": "News", "nav.news": "News",
"nav.editorial": "Editorial",
"nav.archive": "Archive", "nav.archive": "Archive",
"nav.programs": "Programs", "nav.programs": "Programs",
"nav.contact": "Contact", "nav.contact": "Contact",
@ -174,6 +175,15 @@
"news.fullnew": "Read Complete Article", "news.fullnew": "Read Complete Article",
"news.all": "All", "news.all": "All",
"news.allYears": "All years", "news.allYears": "All years",
"editorial.title": "Editorial",
"editorial.text": "Analysis and institutional reflection",
"editorial.text2": "Analysis, opinion and reflection articles from the Kingdom of Peace and Justice Center.",
"editorial.text3": "This page brings together editorials and analysis from the Kingdom of Peace and Justice Center.",
"editorial.buttonLable": "See More Editorials",
"editorial.seemore": "See More",
"editorial.fullnew": "Read Full Editorial",
"editorial.all": "All",
"editorial.allYears": "All years",
"participate.title": "Participate | Collaborate", "participate.title": "Participate | Collaborate",
"participate.text": "Joining means making a commitment with purpose", "participate.text": "Joining means making a commitment with purpose",
"participate.text2": "The work of KPJC is strengthened by the participation of individuals and institutions aligned with its values and overarching objectives:", "participate.text2": "The work of KPJC is strengthened by the participation of individuals and institutions aligned with its values and overarching objectives:",

View File

@ -4,6 +4,7 @@
"nav.home": "Inicio", "nav.home": "Inicio",
"nav.about": "Somos", "nav.about": "Somos",
"nav.news": "Noticias", "nav.news": "Noticias",
"nav.editorial": "Editorial",
"nav.programs": "Programas", "nav.programs": "Programas",
"nav.archive": "Archivo", "nav.archive": "Archivo",
"nav.nations": "Naciones", "nav.nations": "Naciones",
@ -174,6 +175,15 @@
"news.fullnew": "Leer Noticia Completa", "news.fullnew": "Leer Noticia Completa",
"news.all": "Todas", "news.all": "Todas",
"news.allYears": "Todos los años", "news.allYears": "Todos los años",
"editorial.title": "Editorial",
"editorial.text": "Análisis, postura y direccion del Centro del Reino de Paz y Justicia sobre acontecimientos mundiales",
"editorial.text2": "Artículos de análisis, opinión y reflexión del Centro del Reino de Paz y Justicia.",
"editorial.text3": "Esta página reúne los editoriales y análisis del Centro del Reino de Paz y Justicia.",
"editorial.buttonLable": "Ver Más Editoriales",
"editorial.seemore": "Ver Más",
"editorial.fullnew": "Leer Editorial Completo",
"editorial.all": "Todas",
"editorial.allYears": "Todos los años",
"participate.title": "Participa | Colabora", "participate.title": "Participa | Colabora",
"participate.text": "Sumarse es asumir un compromiso con propósito", "participate.text": "Sumarse es asumir un compromiso con propósito",
"participate.text2": "La labor del <strong>Centro del Reino de Paz y Justicia</strong> se fortalece mediante la participación de personas e instituciones alineadas con sus valores y objetivos generales. Formas de participar:", "participate.text2": "La labor del <strong>Centro del Reino de Paz y Justicia</strong> se fortalece mediante la participación de personas e instituciones alineadas con sus valores y objetivos generales. Formas de participar:",

View File

@ -4,6 +4,7 @@
"nav.home": "Accueil", "nav.home": "Accueil",
"nav.about": "Qui sommes-nous", "nav.about": "Qui sommes-nous",
"nav.news": "Informations", "nav.news": "Informations",
"nav.editorial": "Éditorial",
"nav.programs": "Programmes", "nav.programs": "Programmes",
"nav.archive": "Archivo", "nav.archive": "Archivo",
"nav.nations": "Naciones", "nav.nations": "Naciones",
@ -174,6 +175,15 @@
"news.fullnew": "Lire l'Article Complète", "news.fullnew": "Lire l'Article Complète",
"news.all": "Todas", "news.all": "Todas",
"news.allYears": "Todos los años", "news.allYears": "Todos los años",
"editorial.title": "Éditorial",
"editorial.text": "Analyse et réflexion institutionnelle",
"editorial.text2": "Articles d'analyse, d'opinion et de réflexion du Centre du Royaume de Paix et de Justice.",
"editorial.text3": "Cette page rassemble les éditoriaux et analyses du Centre du Royaume de Paix et de Justice.",
"editorial.buttonLable": "Voir Plus d'Éditoriaux",
"editorial.seemore": "Voir Plus",
"editorial.fullnew": "Lire l'Éditorial Complet",
"editorial.all": "Tous",
"editorial.allYears": "Toutes les années",
"participate.title": "Participez | Collaborez", "participate.title": "Participez | Collaborez",
"participate.text": "Se joindre, cest prendre un engagement avec un but", "participate.text": "Se joindre, cest prendre un engagement avec un but",
"participate.text2": "Le travail du Centre du Royaume de Paix et de Justice se fortifie moyennant la participation de personnes et dinstitutions alignées sur ses valeurs et ses objectifs généraux. Façons dy participer :", "participate.text2": "Le travail du Centre du Royaume de Paix et de Justice se fortifie moyennant la participation de personnes et dinstitutions alignées sur ses valeurs et ses objectifs généraux. Façons dy participer :",

View File

@ -4,6 +4,7 @@
"nav.about": "מי אנחנו", "nav.about": "מי אנחנו",
"nav.home": "דף הבית", "nav.home": "דף הבית",
"nav.news": "חדשות", "nav.news": "חדשות",
"nav.editorial": "מאמר",
"nav.programs": "תוכניות", "nav.programs": "תוכניות",
"nav.contact": "צור קשר", "nav.contact": "צור קשר",
"hero.name": "ד\"ר חוסה בנחמין פרז מאטוס", "hero.name": "ד\"ר חוסה בנחמין פרז מאטוס",
@ -168,6 +169,15 @@
"news.text2": "סקירה זו מציגה את עיקר העשייה, ההישגים והיוזמות של מרכז הממלכה לשלום וצדק ומייסדו.", "news.text2": "סקירה זו מציגה את עיקר העשייה, ההישגים והיוזמות של מרכז הממלכה לשלום וצדק ומייסדו.",
"news.text3": "דף זה מציגה את עיקר העשייה, ההישגים והיוזמות של מרכז הממלכה לשלום וצדק ומייסדו.", "news.text3": "דף זה מציגה את עיקר העשייה, ההישגים והיוזמות של מרכז הממלכה לשלום וצדק ומייסדו.",
"news.buttonLable": "עוד חדשות", "news.buttonLable": "עוד חדשות",
"editorial.title": "מאמר",
"editorial.text": "ניתוח והרהור מוסדי",
"editorial.text2": "מאמרי ניתוח, דעה והרהור ממרכז ממלכת השלום והצדק.",
"editorial.text3": "עמוד זה מרכז את המאמרים והניתוחים של מרכז ממלכת השלום והצדק.",
"editorial.buttonLable": "עוד מאמרים",
"editorial.seemore": "עוד",
"editorial.fullnew": "קרא מאמר מלא",
"editorial.all": "הכל",
"editorial.allYears": "כל השנים",
"participate.title": "השתתפו | הצטרפו", "participate.title": "השתתפו | הצטרפו",
"participate.text": "להצטרף אלינו זה התחייבות עם ייעוד", "participate.text": "להצטרף אלינו זה התחייבות עם ייעוד",
"participate.text2": "עבודת המרכז מתחזקת עם השתתפותם של אנשים ומוסדות החולקים ערכים ומטרות כלליות משותפות.", "participate.text2": "עבודת המרכז מתחזקת עם השתתפותם של אנשים ומוסדות החולקים ערכים ומטרות כלליות משותפות.",

View File

@ -24,6 +24,17 @@ export const routeTranslations = {
ru: "новости", ru: "новости",
rw: "amakuru", rw: "amakuru",
kr: "nouvel", kr: "nouvel",
},
editorial: {
es: "editorial",
en: "editorial",
fr: "editorial",
he: "מאמר",
uk: "editorial",
pt: "editorial",
ru: "редакция",
rw: "editorial",
kr: "editorial",
} }
} as const; } as const;

View File

@ -3,6 +3,7 @@
"nav.logo_line2": "pou Lapè ak Jistis", "nav.logo_line2": "pou Lapè ak Jistis",
"nav.about": "Osijè nou", "nav.about": "Osijè nou",
"nav.news": "Nouvèl", "nav.news": "Nouvèl",
"nav.editorial": "Editoryal",
"nav.programs": "Pwogram", "nav.programs": "Pwogram",
"nav.archive": "Archivo", "nav.archive": "Archivo",
"nav.nations": "Naciones", "nav.nations": "Naciones",
@ -172,6 +173,15 @@
"news.seemore": "Voir Plus", "news.seemore": "Voir Plus",
"news.all": "Tozut", "news.all": "Tozut",
"news.allYears": "Tout ane yo", "news.allYears": "Tout ane yo",
"editorial.title": "Editoryal",
"editorial.text": "Analiz ak refleksyon enstitisyonèl",
"editorial.text2": "Atik analiz, opinyon ak refleksyon Sant Wayòm Lapè ak Jistis la.",
"editorial.text3": "Paj sa a rasanble editoryal ak analiz Sant Wayòm Lapè ak Jistis la.",
"editorial.buttonLable": "Wè plis editoryal",
"editorial.seemore": "Wè plis",
"editorial.fullnew": "Li Editoryal Konplè",
"editorial.all": "Tout",
"editorial.allYears": "Tout ane yo",
"participate.title": "Patisipe/ kolabore", "participate.title": "Patisipe/ kolabore",
"participate.text": "Rantre vle di pran yon angajman ak yon objektif", "participate.text": "Rantre vle di pran yon angajman ak yon objektif",
"participate.text2": "Travay Sant Wayòm pou Lapè ak Jistis ranfòse gras ak patisipasyon moun ak enstitisyon yo ki annakò ak valè e objektif jeneral li yo.", "participate.text2": "Travay Sant Wayòm pou Lapè ak Jistis ranfòse gras ak patisipasyon moun ak enstitisyon yo ki annakò ak valè e objektif jeneral li yo.",

View File

@ -4,6 +4,7 @@
"nav.home": "home", "nav.home": "home",
"nav.about": "Sobre nós", "nav.about": "Sobre nós",
"nav.news": "Notícias", "nav.news": "Notícias",
"nav.editorial": "Editorial",
"nav.programs": "Programas", "nav.programs": "Programas",
"nav.archive": "Arquivo", "nav.archive": "Arquivo",
"nav.nations": "Nações", "nav.nations": "Nações",
@ -174,6 +175,15 @@
"news.fullnew": "Ler o Artigo Completo", "news.fullnew": "Ler o Artigo Completo",
"news.all": "Todos", "news.all": "Todos",
"news.allYears": "Todos os anos", "news.allYears": "Todos os anos",
"editorial.title": "Editorial",
"editorial.text": "Análise e reflexão institucional",
"editorial.text2": "Artigos de análise, opinião e reflexão do Centro do Reino de Paz e Justiça.",
"editorial.text3": "Esta página reúne os editoriais e análises do Centro do Reino de Paz e Justiça.",
"editorial.buttonLable": "Ver Mais Editoriais",
"editorial.seemore": "Ver Mais",
"editorial.fullnew": "Ler Editorial Completo",
"editorial.all": "Todos",
"editorial.allYears": "Todos os anos",
"participate.title": "Participe | Colabore", "participate.title": "Participe | Colabore",
"participate.text": "Unir-se é assumir um compromisso com propósito.", "participate.text": "Unir-se é assumir um compromisso com propósito.",
"participate.text2": "O trabalho do <strong>Centro do Reino de Paz e Justiça</strong> se fortalece por meio da participação de pessoas e instituições alinhadas com seus valores e objetivos gerais. Formas de participar:", "participate.text2": "O trabalho do <strong>Centro do Reino de Paz e Justiça</strong> se fortalece por meio da participação de pessoas e instituições alinhadas com seus valores e objetivos gerais. Formas de participar:",

View File

@ -4,6 +4,7 @@
"nav.home": "Главная", "nav.home": "Главная",
"nav.about": "О нас", "nav.about": "О нас",
"nav.news": "Новости", "nav.news": "Новости",
"nav.editorial": "Редакция",
"nav.programs": "Программы", "nav.programs": "Программы",
"nav.contact": "Контакты", "nav.contact": "Контакты",
@ -187,6 +188,15 @@
"news.text2": "В этом разделе представлены ключевые мероприятия, награды и инициативы Центра Царства мира и справедливости (ЦЦМС) и его основателя", "news.text2": "В этом разделе представлены ключевые мероприятия, награды и инициативы Центра Царства мира и справедливости (ЦЦМС) и его основателя",
"news.text3": "Esta página reúne las principales actividades, reconocimientos y acciones del Centro del Reino de Paz y Justicia y de su fundador.", "news.text3": "Esta página reúne las principales actividades, reconocimientos y acciones del Centro del Reino de Paz y Justicia y de su fundador.",
"news.buttonLable": "Ver Más Noticias", "news.buttonLable": "Ver Más Noticias",
"editorial.title": "Редакция",
"editorial.text": "Анализ и институциональная рефлексия",
"editorial.text2": "Статьи с анализом, мнениями и размышлениями Центра Царства Мира и Справедливости.",
"editorial.text3": "На этой странице собраны редакционные статьи и аналитика Центра Царства Мира и Справедливости.",
"editorial.buttonLable": "Больше редакционных",
"editorial.seemore": "Подробнее",
"editorial.fullnew": "Читать полностью",
"editorial.all": "Все",
"editorial.allYears": "Все годы",
"participate.title": "Присоединяйтесь и сотрудничайте", "participate.title": "Присоединяйтесь и сотрудничайте",
"participate.text": "Присоединение означает принятие осознанной миссии и ответственности", "participate.text": "Присоединение означает принятие осознанной миссии и ответственности",

View File

@ -4,6 +4,7 @@
"nav.home": "Home", "nav.home": "Home",
"nav.about": "Abo turi bo", "nav.about": "Abo turi bo",
"nav.news": "Amakuru", "nav.news": "Amakuru",
"nav.editorial": "Inyandiko",
"nav.programs": "Porogaramu", "nav.programs": "Porogaramu",
"nav.archive": "Archivo", "nav.archive": "Archivo",
"nav.nations": "Naciones", "nav.nations": "Naciones",
@ -174,6 +175,15 @@
"news.fullnew": "Read Complete Article", "news.fullnew": "Read Complete Article",
"news.all": "byose", "news.all": "byose",
"news.allYears": "Amaezi yose", "news.allYears": "Amaezi yose",
"editorial.title": "Inyandiko",
"editorial.text": "Isesengura no gutekereza ku nzego",
"editorial.text2": "Ingingo z'isesengura, ibitekerezo no gutekereza biheruka bijyanye na Centre du Royaume de Paix et de Justice.",
"editorial.text3": "Iyi paji ikusanya inyandiko z'ubuyobozi n'isesengura bya Centre du Royaume de Paix et de Justice.",
"editorial.buttonLable": "Reba izindi nyandiko",
"editorial.seemore": "Reba byinshi",
"editorial.fullnew": "Soma inyandiko yuzuye",
"editorial.all": "Byose",
"editorial.allYears": "Imyaka yose",
"participate.title": "Uruhare rwawe | Imikoranire", "participate.title": "Uruhare rwawe | Imikoranire",
"participate.text": "Kwinjira ni ukwiyemeza inshingano ifite intego.", "participate.text": "Kwinjira ni ukwiyemeza inshingano ifite intego.",
"participate.text2": "Umurimo wa Centro del Reino de Paz y Justicia urushaho gukomera binyuze mu ruhare rwabantu ninzego zihuza nindangagaciro nintego zacyo rusange. Uburyo bwo kugira uruhare:", "participate.text2": "Umurimo wa Centro del Reino de Paz y Justicia urushaho gukomera binyuze mu ruhare rwabantu ninzego zihuza nindangagaciro nintego zacyo rusange. Uburyo bwo kugira uruhare:",

View File

@ -3,6 +3,17 @@
"nav.logo_line2": "de Paz y Justicia", "nav.logo_line2": "de Paz y Justicia",
"nav.about": "Somos", "nav.about": "Somos",
"nav.news": "Noticias", "nav.news": "Noticias",
"nav.editorial": "Редакційна",
"nav.programs": "Programas", "nav.programs": "Programas",
"nav.contact": "Contacto" "nav.contact": "Contacto",
"news.buttonLable": "Більше новин",
"editorial.title": "Редакційна",
"editorial.text": "Аналіз та інституційна рефлексія",
"editorial.text2": "Статті з аналізу, думок та роздумів Центру Королівства Миру та Справедливості.",
"editorial.text3": "Ця сторінка збирає редакційні статті та аналітику Центру Королівства Миру та Справедливості.",
"editorial.buttonLable": "Більше редакційних",
"editorial.seemore": "Більше",
"editorial.fullnew": "Читати повністю",
"editorial.all": "Всі",
"editorial.allYears": "Всі роки"
} }

View File

@ -14,7 +14,9 @@ const currentLocale = Astro.currentLocale ?? "es";
const direction = currentLocale === "he" ? "rtl" : "ltr"; const direction = currentLocale === "he" ? "rtl" : "ltr";
const newsSegments = Object.values(routeTranslations.news); const newsSegments = Object.values(routeTranslations.news);
const isNewsPage = newsSegments.some((segment) => const editorialSegments = Object.values(routeTranslations.editorial);
const contentSegments = [...newsSegments, ...editorialSegments];
const isNewsPage = contentSegments.some((segment) =>
Astro.url.pathname.includes(`/${segment}/`) Astro.url.pathname.includes(`/${segment}/`)
); );
--- ---

View File

@ -0,0 +1,143 @@
---
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("editorial");
return posts.map((post) => ({
params: {
id: post.id,
locale: post.data.locale,
editorial_slug: getLocalizedRoute("editorial", post.data.locale),
},
props: { post },
}));
}
const { locale, editorial_slug } = Astro.params;
// 2. For your template, you can get the entry directly from the prop
const { post } = Astro.props;
const { Content } = await render(post);
const baseSlug = editorial_slug;
const rawContent = post.body || "";
const plainText = rawContent
.replace(/^#.*$/gm, "")
.replace(/^###.*$/gm, "")
.replace(/\*\*([^*]+)\*\*/g, "$1")
.replace(/\*([^*]+)\*/g, "$1")
.replace(/_([^_]+)_/g, "$1")
.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1")
.replace(/^>.*$/gm, "")
.replace(/`[^`]+`/g, "")
.replace(/^[-*]\s+/gm, "")
.trim();
const words = plainText
.split(/\s+/)
.filter((w) => w.length > 0)
.slice(0, 35);
const excerpt = words.join(" ") + (words.length === 35 ? "..." : "");
const canonicalUrl = new URL(`/${locale}/${editorial_slug}/${post.id}`, Astro.site);
const imageUrl = post.data.thumbnail
? new URL(post.data.thumbnail, Astro.site).toString()
: null;
const localeDate = new Intl.DateTimeFormat(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}`;
---
<MainLayout
title={post.data.title}
description={excerpt}
image={post.data.thumbnail}
url={canonicalUrl.toString()}
date={post.data.date}
>
<script
type="application/ld+json"
set:html={JSON.stringify({
"@context": "https://schema.org",
"@type": "Article",
headline: post.data.title,
datePublished: post.data.date,
description: excerpt,
image: imageUrl,
url: canonicalUrl.toString(),
author: {
"@type": "Organization",
name: "Centro del Reino de Paz y Justicia",
},
})}
></script>
<div class="container mx-auto md:py-16 py-8">
<Header />
</div>
<a class="block">
<TitleSection title={post.data.title} />
</a>
<div class="container mx-auto">
<a class="block">
{
post.data.gallery?.length ? (
<CarouselSection images={post.data.gallery} />
) : post.data.thumbnail ? (
<Image
src={post.data.thumbnail}
alt={post.data.title}
class="hover:opacity-90 transition-opacity"
/>
) : null
}
</a>
</div>
<div class="grid md:grid-cols-10 container mx-auto">
<div
id="article-content"
class="md:col-span-7 content bg-white p-8 md:p-20 prose-p:mb-4 text-[#003421] text-justify"
>
<article id="article-body">
<time
id="article-date"
class="block text-center text-[#003421]/60 text-sm mb-8 hidden"
datetime={dateISO}
>
{localeDate}
</time>
<Content />
</article>
</div>
<div class="md:col-span-3 bg-tertiary md:sticky top-0 self-start">
{post.data.youtube && <YouTube id={post.data.youtube} />}
{
post.data.gallery &&
post.data.gallery.map((galleryImage, i) => (
<button type="button" data-lightbox-index={i} data-lightbox-src={galleryImage.image} data-lightbox-alt={galleryImage.text} class="cursor-pointer block w-full text-left">
<Image src={galleryImage.image} alt={galleryImage.text} />
</button>
))
}
</div>
</div>
</MainLayout>
<FooterSection />

View File

@ -0,0 +1,58 @@
---
import MainLayout from "@/layouts/MainLayout.astro"
import Header from "@/components/Header.astro"
import NewsList from "@/components/cards/NewsList.astro";
import { getCollection } from "astro:content";
import FooterSection from "@/components/section/FooterSection.astro";
import { createTranslator, getLocalizedRoute, routeTranslations } from '@/i18n';
const tl = createTranslator(Astro.currentLocale);
export function getStaticPaths() {
const locales = Object.keys(routeTranslations.editorial);
return locales.map((locale) => ({
params: {
locale,
editorial_slug: getLocalizedRoute('editorial', locale)
},
}));
}
const { locale, editorial_slug } = Astro.params;
const items = await getCollection("editorial", (post)=>{
const currentLocale = Astro.currentLocale;
return post.data.locale == currentLocale
});
const sortedPosts = [...items]
.sort((a, b) => {
const dateDiff = new Date(b.data.date).getTime() - new Date(a.data.date).getTime()
if (dateDiff !== 0) return dateDiff
return (a.data.order ?? 0) - (b.data.order ?? 0)
});
---
<MainLayout >
<div class="top-16 relative mb container mx-auto">
<Header />
</div>
<div class="container mx-auto mt-4">
<div class="flex flex-col lg:w-1/2 items-center mx-auto py-8">
<h1 class="text-white text-2xl uppercase font-bold text-center mb-4 font-primary md:mt-20 mt-10">{tl("editorial.title")}</h1>
<h2 class="text-white text-3xl lg:text-2xl font-bold text-center font-secondary mb-4 md:p-0 px-2">{tl("editorial.text")}</h2>
</div>
<div class="flex flex-col md:gap-0 gap-2 lg:max-w-4xl mx-auto bg-white p-4 md:p-8">
{
sortedPosts.map((item) => (
<div class="news-item">
<NewsList data={item} content={{ body: item.body }} routeKey="editorial" />
</div>
))
}
</div>
</div>
<FooterSection />
</MainLayout>

View File

@ -4,6 +4,7 @@ import "../../styles/global.css";
import MainLayout from "../../layouts/MainLayout.astro"; import MainLayout from "../../layouts/MainLayout.astro";
import HeroHome from "../../components/HeroHome.astro"; import HeroHome from "../../components/HeroHome.astro";
import NewsSection from "../../components/section/NewsSection.astro"; import NewsSection from "../../components/section/NewsSection.astro";
import EditorialHomeList from "../../components/section/EditorialHomeList.astro";
import ParticipateSection from "../../components/section/ParticipateSection.astro"; import ParticipateSection from "../../components/section/ParticipateSection.astro";
import CarouselSection from "../../components/section/CarouselSection.astro"; import CarouselSection from "../../components/section/CarouselSection.astro";
import InfoSection from "../../components/section/InfoSection.astro"; import InfoSection from "../../components/section/InfoSection.astro";
@ -93,6 +94,8 @@ const carouselImages3 = [
<NewsSection /> <NewsSection />
<EditorialHomeList />
<ParticipateSection /> <ParticipateSection />
<FooterSection /> <FooterSection />

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["news","documentaries"]},"Node":{"type":"Node","resolveType":"nodeDocument"},"DocumentNode":{"type":"DocumentNode","resolveType":"multiCollectionDocument","createDocument":"create","updateDocument":"update"},"News":{"type":"News","resolveType":"collectionDocument","collection":"news","createNews":"create","updateNews":"update"},"NewsConnection":{"type":"NewsConnection","resolveType":"collectionDocumentList","collection":"news"},"Documentaries":{"type":"Documentaries","resolveType":"collectionDocument","collection":"documentaries","createDocumentaries":"create","updateDocumentaries":"update"},"DocumentariesConnection":{"type":"DocumentariesConnection","resolveType":"collectionDocumentList","collection":"documentaries"}} {"DocumentConnection":{"type":"DocumentConnection","resolveType":"multiCollectionDocumentList","collections":["news","editorial"]},"Node":{"type":"Node","resolveType":"nodeDocument"},"DocumentNode":{"type":"DocumentNode","resolveType":"multiCollectionDocument","createDocument":"create","updateDocument":"update"},"News":{"type":"News","resolveType":"collectionDocument","collection":"news","createNews":"create","updateNews":"update"},"NewsConnection":{"type":"NewsConnection","resolveType":"collectionDocumentList","collection":"news"},"Editorial":{"type":"Editorial","resolveType":"collectionDocument","collection":"editorial","createEditorial":"create","updateEditorial":"update"},"EditorialConnection":{"type":"EditorialConnection","resolveType":"collectionDocumentList","collection":"editorial"}}

View File

@ -1 +1 @@
{"version":{"fullVersion":"2.4.2","major":"2","minor":"4","patch":"2"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"news","label":"News","path":"src/content/news","format":"md","match":{"include":"**/*"},"ui":{"filename":{"readonly":false}},"fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"},{"label":"Português","value":"pt"},{"label":"Kinyarwanda","value":"rw"},{"label":"Frances","value":"fr"}],"namespace":["news","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["news","title"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["news","date"],"searchable":true,"uid":false},{"type":"string","name":"slug","label":"Slug","namespace":["news","slug"],"searchable":true,"uid":false},{"type":"string","name":"place","label":"Place","namespace":["news","place"],"searchable":true,"uid":false},{"type":"string","name":"country","label":"Country","namespace":["news","country"],"searchable":true,"uid":false},{"type":"string","name":"city","label":"City","namespace":["news","city"],"searchable":true,"uid":false},{"type":"image","name":"thumbnail","label":"Thumbnail URL","namespace":["news","thumbnail"],"searchable":false,"uid":false},{"type":"image","name":"thumbnail_square","label":"Thumbnail Square URL","namespace":["news","thumbnail_square"],"searchable":false,"uid":false},{"type":"string","name":"tags","label":"Tags","list":true,"namespace":["news","tags"],"searchable":true,"uid":false},{"type":"object","name":"gallery","label":"Gallery","list":true,"fields":[{"type":"image","name":"image","label":"Image","namespace":["news","gallery","image"],"searchable":false,"uid":false}],"namespace":["news","gallery"],"searchable":true,"uid":false},{"type":"string","name":"youtube","label":"YouTube ID","namespace":["news","youtube"],"searchable":true,"uid":false},{"type":"boolean","name":"draft","label":"Draft","namespace":["news","draft"],"searchable":true,"uid":false},{"type":"rich-text","name":"body","label":"Content","isBody":true,"namespace":["news","body"],"searchable":true,"parser":{"type":"markdown"},"uid":false}],"namespace":["news"]},{"name":"documentaries","label":"Documentaries","path":"src/content/documentaries","format":"md","fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"},{"label":"Português","value":"pt"},{"label":"Kinyarwanda","value":"rw"}],"namespace":["documentaries","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["documentaries","title"],"searchable":true,"uid":false},{"type":"string","name":"video_yt","label":"YouTube ID","namespace":["documentaries","video_yt"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["documentaries","date"],"searchable":true,"uid":false}],"namespace":["documentaries"]}],"config":{"media":{"tina":{"publicFolder":"public","mediaRoot":"public/images"}}}} {"version":{"fullVersion":"2.4.2","major":"2","minor":"4","patch":"2"},"meta":{"flags":["experimentalData"]},"collections":[{"name":"news","label":"News","path":"src/content/news","format":"md","match":{"include":"**/*"},"ui":{"filename":{"readonly":false}},"fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"},{"label":"Português","value":"pt"},{"label":"Kinyarwanda","value":"rw"},{"label":"Frances","value":"fr"}],"namespace":["news","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["news","title"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["news","date"],"searchable":true,"uid":false},{"type":"string","name":"slug","label":"Slug","namespace":["news","slug"],"searchable":true,"uid":false},{"type":"string","name":"place","label":"Place","namespace":["news","place"],"searchable":true,"uid":false},{"type":"string","name":"country","label":"Country","namespace":["news","country"],"searchable":true,"uid":false},{"type":"string","name":"city","label":"City","namespace":["news","city"],"searchable":true,"uid":false},{"type":"image","name":"thumbnail","label":"Thumbnail URL","namespace":["news","thumbnail"],"searchable":false,"uid":false},{"type":"image","name":"thumbnail_square","label":"Thumbnail Square URL","namespace":["news","thumbnail_square"],"searchable":false,"uid":false},{"type":"string","name":"tags","label":"Tags","list":true,"namespace":["news","tags"],"searchable":true,"uid":false},{"type":"object","name":"gallery","label":"Gallery","list":true,"fields":[{"type":"image","name":"image","label":"Image","namespace":["news","gallery","image"],"searchable":false,"uid":false}],"namespace":["news","gallery"],"searchable":true,"uid":false},{"type":"string","name":"youtube","label":"YouTube ID","namespace":["news","youtube"],"searchable":true,"uid":false},{"type":"boolean","name":"draft","label":"Draft","namespace":["news","draft"],"searchable":true,"uid":false},{"type":"rich-text","name":"body","label":"Content","isBody":true,"namespace":["news","body"],"searchable":true,"parser":{"type":"markdown"},"uid":false}],"namespace":["news"]},{"name":"editorial","label":"Editorial","path":"src/content/editorial","format":"md","match":{"include":"**/*"},"ui":{"filename":{"readonly":false}},"fields":[{"type":"string","name":"locale","label":"Language","options":[{"label":"Español","value":"es"},{"label":"English","value":"en"},{"label":"Português","value":"pt"},{"label":"Kinyarwanda","value":"rw"},{"label":"Frances","value":"fr"}],"namespace":["editorial","locale"],"searchable":true,"uid":false},{"type":"string","name":"title","label":"Title","isTitle":true,"required":true,"namespace":["editorial","title"],"searchable":true,"uid":false},{"type":"datetime","name":"date","label":"Date","required":true,"namespace":["editorial","date"],"searchable":true,"uid":false},{"type":"string","name":"slug","label":"Slug","namespace":["editorial","slug"],"searchable":true,"uid":false},{"type":"string","name":"place","label":"Place","namespace":["editorial","place"],"searchable":true,"uid":false},{"type":"string","name":"country","label":"Country","namespace":["editorial","country"],"searchable":true,"uid":false},{"type":"string","name":"city","label":"City","namespace":["editorial","city"],"searchable":true,"uid":false},{"type":"image","name":"thumbnail","label":"Thumbnail URL","namespace":["editorial","thumbnail"],"searchable":false,"uid":false},{"type":"image","name":"thumbnail_square","label":"Thumbnail Square URL","namespace":["editorial","thumbnail_square"],"searchable":false,"uid":false},{"type":"string","name":"tags","label":"Tags","list":true,"namespace":["editorial","tags"],"searchable":true,"uid":false},{"type":"object","name":"gallery","label":"Gallery","list":true,"fields":[{"type":"image","name":"image","label":"Image","namespace":["editorial","gallery","image"],"searchable":false,"uid":false}],"namespace":["editorial","gallery"],"searchable":true,"uid":false},{"type":"string","name":"youtube","label":"YouTube ID","namespace":["editorial","youtube"],"searchable":true,"uid":false},{"type":"boolean","name":"draft","label":"Draft","namespace":["editorial","draft"],"searchable":true,"uid":false},{"type":"rich-text","name":"body","label":"Content","isBody":true,"namespace":["editorial","body"],"searchable":true,"parser":{"type":"markdown"},"uid":false}],"namespace":["editorial"]}],"config":{"media":{"tina":{"publicFolder":"public","mediaRoot":"public/images"}}}}

View File

@ -127,10 +127,21 @@ var config_default = defineConfig({
] ]
}, },
{ {
name: "documentaries", name: "editorial",
label: "Documentaries", label: "Editorial",
path: "src/content/documentaries", path: "src/content/editorial",
format: "md", format: "md",
match: {
include: "**/*"
},
ui: {
filename: {
readonly: false,
slugify: (values) => {
return values?.slug?.toLowerCase() || values?.title?.toLowerCase().replace(/ /g, "-");
}
}
},
fields: [ fields: [
{ {
type: "string", type: "string",
@ -140,7 +151,8 @@ var config_default = defineConfig({
{ label: "Espa\xF1ol", value: "es" }, { label: "Espa\xF1ol", value: "es" },
{ label: "English", value: "en" }, { label: "English", value: "en" },
{ label: "Portugu\xEAs", value: "pt" }, { label: "Portugu\xEAs", value: "pt" },
{ label: "Kinyarwanda", value: "rw" } { label: "Kinyarwanda", value: "rw" },
{ label: "Frances", value: "fr" }
] ]
}, },
{ {
@ -150,16 +162,76 @@ var config_default = defineConfig({
isTitle: true, isTitle: true,
required: true required: true
}, },
{
type: "string",
name: "video_yt",
label: "YouTube ID"
},
{ {
type: "datetime", type: "datetime",
name: "date", name: "date",
label: "Date", label: "Date",
required: true required: true
},
{
type: "string",
name: "slug",
label: "Slug"
},
{
type: "string",
name: "place",
label: "Place"
},
{
type: "string",
name: "country",
label: "Country"
},
{
type: "string",
name: "city",
label: "City"
},
{
type: "image",
name: "thumbnail",
label: "Thumbnail URL"
},
{
type: "image",
name: "thumbnail_square",
label: "Thumbnail Square URL"
},
{
type: "string",
name: "tags",
label: "Tags",
list: true
},
{
type: "object",
name: "gallery",
label: "Gallery",
list: true,
fields: [
{
type: "image",
name: "image",
label: "Image"
}
]
},
{
type: "string",
name: "youtube",
label: "YouTube ID"
},
{
type: "boolean",
name: "draft",
label: "Draft"
},
{
type: "rich-text",
name: "body",
label: "Content",
isBody: true
} }
] ]
} }

View File

@ -19,10 +19,23 @@ fragment NewsParts on News {
body body
} }
fragment DocumentariesParts on Documentaries { fragment EditorialParts on Editorial {
__typename __typename
locale locale
title title
video_yt
date date
slug
place
country
city
thumbnail
thumbnail_square
tags
gallery {
__typename
image
}
youtube
draft
body
} }

View File

@ -53,8 +53,8 @@ query newsConnection($before: String, $after: String, $first: Float, $last: Floa
} }
} }
query documentaries($relativePath: String!) { query editorial($relativePath: String!) {
documentaries(relativePath: $relativePath) { editorial(relativePath: $relativePath) {
... on Document { ... on Document {
_sys { _sys {
filename filename
@ -67,12 +67,12 @@ query documentaries($relativePath: String!) {
} }
id id
} }
...DocumentariesParts ...EditorialParts
} }
} }
query documentariesConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: DocumentariesFilter) { query editorialConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: EditorialFilter) {
documentariesConnection( editorialConnection(
before: $before before: $before
after: $after after: $after
first: $first first: $first
@ -102,7 +102,7 @@ query documentariesConnection($before: String, $after: String, $first: Float, $l
} }
id id
} }
...DocumentariesParts ...EditorialParts
} }
} }
} }

View File

@ -56,13 +56,13 @@ type Query {
document(collection: String, relativePath: String): DocumentNode! document(collection: String, relativePath: String): DocumentNode!
news(relativePath: String): News! news(relativePath: String): News!
newsConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: NewsFilter): NewsConnection! newsConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: NewsFilter): NewsConnection!
documentaries(relativePath: String): Documentaries! editorial(relativePath: String): Editorial!
documentariesConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentariesFilter): DocumentariesConnection! editorialConnection(before: String, after: String, first: Float, last: Float, sort: String, filter: EditorialFilter): EditorialConnection!
} }
input DocumentFilter { input DocumentFilter {
news: NewsFilter news: NewsFilter
documentaries: DocumentariesFilter editorial: EditorialFilter
} }
type DocumentConnectionEdges { type DocumentConnectionEdges {
@ -88,7 +88,7 @@ type Collection {
documents(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentFilter, folder: String): DocumentConnection! documents(before: String, after: String, first: Float, last: Float, sort: String, filter: DocumentFilter, folder: String): DocumentConnection!
} }
union DocumentNode = News | Documentaries | Folder union DocumentNode = News | Editorial | Folder
type NewsGallery { type NewsGallery {
image: String image: String
@ -179,32 +179,60 @@ type NewsConnection implements Connection {
edges: [NewsConnectionEdges] edges: [NewsConnectionEdges]
} }
type Documentaries implements Node & Document { type EditorialGallery {
image: String
}
type Editorial implements Node & Document {
locale: String locale: String
title: String! title: String!
video_yt: String
date: String! date: String!
slug: String
place: String
country: String
city: String
thumbnail: String
thumbnail_square: String
tags: [String]
gallery: [EditorialGallery]
youtube: String
draft: Boolean
body: JSON
id: ID! id: ID!
_sys: SystemInfo! _sys: SystemInfo!
_values: JSON! _values: JSON!
} }
input DocumentariesFilter { input EditorialGalleryFilter {
image: ImageFilter
}
input EditorialFilter {
locale: StringFilter locale: StringFilter
title: StringFilter title: StringFilter
video_yt: StringFilter
date: DatetimeFilter date: DatetimeFilter
slug: StringFilter
place: StringFilter
country: StringFilter
city: StringFilter
thumbnail: ImageFilter
thumbnail_square: ImageFilter
tags: StringFilter
gallery: EditorialGalleryFilter
youtube: StringFilter
draft: BooleanFilter
body: RichTextFilter
} }
type DocumentariesConnectionEdges { type EditorialConnectionEdges {
cursor: String! cursor: String!
node: Documentaries node: Editorial
} }
type DocumentariesConnection implements Connection { type EditorialConnection implements Connection {
pageInfo: PageInfo! pageInfo: PageInfo!
totalCount: Float! totalCount: Float!
edges: [DocumentariesConnectionEdges] edges: [EditorialConnectionEdges]
} }
type Mutation { type Mutation {
@ -215,19 +243,19 @@ type Mutation {
createFolder(collection: String, relativePath: String!): DocumentNode! createFolder(collection: String, relativePath: String!): DocumentNode!
updateNews(relativePath: String!, params: NewsMutation!): News! updateNews(relativePath: String!, params: NewsMutation!): News!
createNews(relativePath: String!, params: NewsMutation!): News! createNews(relativePath: String!, params: NewsMutation!): News!
updateDocumentaries(relativePath: String!, params: DocumentariesMutation!): Documentaries! updateEditorial(relativePath: String!, params: EditorialMutation!): Editorial!
createDocumentaries(relativePath: String!, params: DocumentariesMutation!): Documentaries! createEditorial(relativePath: String!, params: EditorialMutation!): Editorial!
} }
input DocumentUpdateMutation { input DocumentUpdateMutation {
news: NewsMutation news: NewsMutation
documentaries: DocumentariesMutation editorial: EditorialMutation
relativePath: String relativePath: String
} }
input DocumentMutation { input DocumentMutation {
news: NewsMutation news: NewsMutation
documentaries: DocumentariesMutation editorial: EditorialMutation
} }
input NewsGalleryMutation { input NewsGalleryMutation {
@ -251,11 +279,25 @@ input NewsMutation {
body: JSON body: JSON
} }
input DocumentariesMutation { input EditorialGalleryMutation {
image: String
}
input EditorialMutation {
locale: String locale: String
title: String title: String
video_yt: String
date: String date: String
slug: String
place: String
country: String
city: String
thumbnail: String
thumbnail_square: String
tags: [String]
gallery: [EditorialGalleryMutation]
youtube: String
draft: Boolean
body: JSON
} }
schema { schema {

View File

@ -27,13 +27,26 @@ export const NewsPartsFragmentDoc = gql`
body body
} }
`; `;
export const DocumentariesPartsFragmentDoc = gql` export const EditorialPartsFragmentDoc = gql`
fragment DocumentariesParts on Documentaries { fragment EditorialParts on Editorial {
__typename __typename
locale locale
title title
video_yt
date date
slug
place
country
city
thumbnail
thumbnail_square
tags
gallery {
__typename
image
}
youtube
draft
body
} }
`; `;
export const NewsDocument = gql` export const NewsDocument = gql`
@ -93,9 +106,9 @@ export const NewsConnectionDocument = gql`
} }
} }
${NewsPartsFragmentDoc}`; ${NewsPartsFragmentDoc}`;
export const DocumentariesDocument = gql` export const EditorialDocument = gql`
query documentaries($relativePath: String!) { query editorial($relativePath: String!) {
documentaries(relativePath: $relativePath) { editorial(relativePath: $relativePath) {
... on Document { ... on Document {
_sys { _sys {
filename filename
@ -108,13 +121,13 @@ export const DocumentariesDocument = gql`
} }
id id
} }
...DocumentariesParts ...EditorialParts
} }
} }
${DocumentariesPartsFragmentDoc}`; ${EditorialPartsFragmentDoc}`;
export const DocumentariesConnectionDocument = gql` export const EditorialConnectionDocument = gql`
query documentariesConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: DocumentariesFilter) { query editorialConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: EditorialFilter) {
documentariesConnection( editorialConnection(
before: $before before: $before
after: $after after: $after
first: $first first: $first
@ -144,12 +157,12 @@ export const DocumentariesConnectionDocument = gql`
} }
id id
} }
...DocumentariesParts ...EditorialParts
} }
} }
} }
} }
${DocumentariesPartsFragmentDoc}`; ${EditorialPartsFragmentDoc}`;
export function getSdk(requester) { export function getSdk(requester) {
return { return {
news(variables, options) { news(variables, options) {
@ -158,11 +171,11 @@ export function getSdk(requester) {
newsConnection(variables, options) { newsConnection(variables, options) {
return requester(NewsConnectionDocument, variables, options); return requester(NewsConnectionDocument, variables, options);
}, },
documentaries(variables, options) { editorial(variables, options) {
return requester(DocumentariesDocument, variables, options); return requester(EditorialDocument, variables, options);
}, },
documentariesConnection(variables, options) { editorialConnection(variables, options) {
return requester(DocumentariesConnectionDocument, variables, options); return requester(EditorialConnectionDocument, variables, options);
} }
}; };
} }

View File

@ -84,8 +84,8 @@ export type Query = {
document: DocumentNode; document: DocumentNode;
news: News; news: News;
newsConnection: NewsConnection; newsConnection: NewsConnection;
documentaries: Documentaries; editorial: Editorial;
documentariesConnection: DocumentariesConnection; editorialConnection: EditorialConnection;
}; };
@ -125,23 +125,23 @@ export type QueryNewsConnectionArgs = {
}; };
export type QueryDocumentariesArgs = { export type QueryEditorialArgs = {
relativePath?: InputMaybe<Scalars['String']['input']>; relativePath?: InputMaybe<Scalars['String']['input']>;
}; };
export type QueryDocumentariesConnectionArgs = { export type QueryEditorialConnectionArgs = {
before?: InputMaybe<Scalars['String']['input']>; before?: InputMaybe<Scalars['String']['input']>;
after?: InputMaybe<Scalars['String']['input']>; after?: InputMaybe<Scalars['String']['input']>;
first?: InputMaybe<Scalars['Float']['input']>; first?: InputMaybe<Scalars['Float']['input']>;
last?: InputMaybe<Scalars['Float']['input']>; last?: InputMaybe<Scalars['Float']['input']>;
sort?: InputMaybe<Scalars['String']['input']>; sort?: InputMaybe<Scalars['String']['input']>;
filter?: InputMaybe<DocumentariesFilter>; filter?: InputMaybe<EditorialFilter>;
}; };
export type DocumentFilter = { export type DocumentFilter = {
news?: InputMaybe<NewsFilter>; news?: InputMaybe<NewsFilter>;
documentaries?: InputMaybe<DocumentariesFilter>; editorial?: InputMaybe<EditorialFilter>;
}; };
export type DocumentConnectionEdges = { export type DocumentConnectionEdges = {
@ -181,7 +181,7 @@ export type CollectionDocumentsArgs = {
folder?: InputMaybe<Scalars['String']['input']>; folder?: InputMaybe<Scalars['String']['input']>;
}; };
export type DocumentNode = News | Documentaries | Folder; export type DocumentNode = News | Editorial | Folder;
export type NewsGallery = { export type NewsGallery = {
__typename?: 'NewsGallery'; __typename?: 'NewsGallery';
@ -276,35 +276,64 @@ export type NewsConnection = Connection & {
edges?: Maybe<Array<Maybe<NewsConnectionEdges>>>; edges?: Maybe<Array<Maybe<NewsConnectionEdges>>>;
}; };
export type Documentaries = Node & Document & { export type EditorialGallery = {
__typename?: 'Documentaries'; __typename?: 'EditorialGallery';
image?: Maybe<Scalars['String']['output']>;
};
export type Editorial = Node & Document & {
__typename?: 'Editorial';
locale?: Maybe<Scalars['String']['output']>; locale?: Maybe<Scalars['String']['output']>;
title: Scalars['String']['output']; title: Scalars['String']['output'];
video_yt?: Maybe<Scalars['String']['output']>;
date: Scalars['String']['output']; date: Scalars['String']['output'];
slug?: Maybe<Scalars['String']['output']>;
place?: Maybe<Scalars['String']['output']>;
country?: Maybe<Scalars['String']['output']>;
city?: Maybe<Scalars['String']['output']>;
thumbnail?: Maybe<Scalars['String']['output']>;
thumbnail_square?: Maybe<Scalars['String']['output']>;
tags?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
gallery?: Maybe<Array<Maybe<EditorialGallery>>>;
youtube?: Maybe<Scalars['String']['output']>;
draft?: Maybe<Scalars['Boolean']['output']>;
body?: Maybe<Scalars['JSON']['output']>;
id: Scalars['ID']['output']; id: Scalars['ID']['output'];
_sys: SystemInfo; _sys: SystemInfo;
_values: Scalars['JSON']['output']; _values: Scalars['JSON']['output'];
}; };
export type DocumentariesFilter = { export type EditorialGalleryFilter = {
image?: InputMaybe<ImageFilter>;
};
export type EditorialFilter = {
locale?: InputMaybe<StringFilter>; locale?: InputMaybe<StringFilter>;
title?: InputMaybe<StringFilter>; title?: InputMaybe<StringFilter>;
video_yt?: InputMaybe<StringFilter>;
date?: InputMaybe<DatetimeFilter>; date?: InputMaybe<DatetimeFilter>;
slug?: InputMaybe<StringFilter>;
place?: InputMaybe<StringFilter>;
country?: InputMaybe<StringFilter>;
city?: InputMaybe<StringFilter>;
thumbnail?: InputMaybe<ImageFilter>;
thumbnail_square?: InputMaybe<ImageFilter>;
tags?: InputMaybe<StringFilter>;
gallery?: InputMaybe<EditorialGalleryFilter>;
youtube?: InputMaybe<StringFilter>;
draft?: InputMaybe<BooleanFilter>;
body?: InputMaybe<RichTextFilter>;
}; };
export type DocumentariesConnectionEdges = { export type EditorialConnectionEdges = {
__typename?: 'DocumentariesConnectionEdges'; __typename?: 'EditorialConnectionEdges';
cursor: Scalars['String']['output']; cursor: Scalars['String']['output'];
node?: Maybe<Documentaries>; node?: Maybe<Editorial>;
}; };
export type DocumentariesConnection = Connection & { export type EditorialConnection = Connection & {
__typename?: 'DocumentariesConnection'; __typename?: 'EditorialConnection';
pageInfo: PageInfo; pageInfo: PageInfo;
totalCount: Scalars['Float']['output']; totalCount: Scalars['Float']['output'];
edges?: Maybe<Array<Maybe<DocumentariesConnectionEdges>>>; edges?: Maybe<Array<Maybe<EditorialConnectionEdges>>>;
}; };
export type Mutation = { export type Mutation = {
@ -316,8 +345,8 @@ export type Mutation = {
createFolder: DocumentNode; createFolder: DocumentNode;
updateNews: News; updateNews: News;
createNews: News; createNews: News;
updateDocumentaries: Documentaries; updateEditorial: Editorial;
createDocumentaries: Documentaries; createEditorial: Editorial;
}; };
@ -366,26 +395,26 @@ export type MutationCreateNewsArgs = {
}; };
export type MutationUpdateDocumentariesArgs = { export type MutationUpdateEditorialArgs = {
relativePath: Scalars['String']['input']; relativePath: Scalars['String']['input'];
params: DocumentariesMutation; params: EditorialMutation;
}; };
export type MutationCreateDocumentariesArgs = { export type MutationCreateEditorialArgs = {
relativePath: Scalars['String']['input']; relativePath: Scalars['String']['input'];
params: DocumentariesMutation; params: EditorialMutation;
}; };
export type DocumentUpdateMutation = { export type DocumentUpdateMutation = {
news?: InputMaybe<NewsMutation>; news?: InputMaybe<NewsMutation>;
documentaries?: InputMaybe<DocumentariesMutation>; editorial?: InputMaybe<EditorialMutation>;
relativePath?: InputMaybe<Scalars['String']['input']>; relativePath?: InputMaybe<Scalars['String']['input']>;
}; };
export type DocumentMutation = { export type DocumentMutation = {
news?: InputMaybe<NewsMutation>; news?: InputMaybe<NewsMutation>;
documentaries?: InputMaybe<DocumentariesMutation>; editorial?: InputMaybe<EditorialMutation>;
}; };
export type NewsGalleryMutation = { export type NewsGalleryMutation = {
@ -409,16 +438,30 @@ export type NewsMutation = {
body?: InputMaybe<Scalars['JSON']['input']>; body?: InputMaybe<Scalars['JSON']['input']>;
}; };
export type DocumentariesMutation = { export type EditorialGalleryMutation = {
image?: InputMaybe<Scalars['String']['input']>;
};
export type EditorialMutation = {
locale?: InputMaybe<Scalars['String']['input']>; locale?: InputMaybe<Scalars['String']['input']>;
title?: InputMaybe<Scalars['String']['input']>; title?: InputMaybe<Scalars['String']['input']>;
video_yt?: InputMaybe<Scalars['String']['input']>;
date?: InputMaybe<Scalars['String']['input']>; date?: InputMaybe<Scalars['String']['input']>;
slug?: InputMaybe<Scalars['String']['input']>;
place?: InputMaybe<Scalars['String']['input']>;
country?: InputMaybe<Scalars['String']['input']>;
city?: InputMaybe<Scalars['String']['input']>;
thumbnail?: InputMaybe<Scalars['String']['input']>;
thumbnail_square?: InputMaybe<Scalars['String']['input']>;
tags?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
gallery?: InputMaybe<Array<InputMaybe<EditorialGalleryMutation>>>;
youtube?: InputMaybe<Scalars['String']['input']>;
draft?: InputMaybe<Scalars['Boolean']['input']>;
body?: InputMaybe<Scalars['JSON']['input']>;
}; };
export type NewsPartsFragment = { __typename: 'News', locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, gallery?: Array<{ __typename: 'NewsGallery', image?: string | null } | null> | null }; export type NewsPartsFragment = { __typename: 'News', locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, gallery?: Array<{ __typename: 'NewsGallery', image?: string | null } | null> | null };
export type DocumentariesPartsFragment = { __typename: 'Documentaries', locale?: string | null, title: string, video_yt?: string | null, date: string }; export type EditorialPartsFragment = { __typename: 'Editorial', locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, gallery?: Array<{ __typename: 'EditorialGallery', image?: string | null } | null> | null };
export type NewsQueryVariables = Exact<{ export type NewsQueryVariables = Exact<{
relativePath: Scalars['String']['input']; relativePath: Scalars['String']['input'];
@ -439,24 +482,24 @@ export type NewsConnectionQueryVariables = Exact<{
export type NewsConnectionQuery = { __typename?: 'Query', newsConnection: { __typename?: 'NewsConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'NewsConnectionEdges', cursor: string, node?: { __typename: 'News', id: string, locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, gallery?: Array<{ __typename: 'NewsGallery', image?: string | null } | null> | null } | null } | null> | null } }; export type NewsConnectionQuery = { __typename?: 'Query', newsConnection: { __typename?: 'NewsConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'NewsConnectionEdges', cursor: string, node?: { __typename: 'News', id: string, locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, gallery?: Array<{ __typename: 'NewsGallery', image?: string | null } | null> | null } | null } | null> | null } };
export type DocumentariesQueryVariables = Exact<{ export type EditorialQueryVariables = Exact<{
relativePath: Scalars['String']['input']; relativePath: Scalars['String']['input'];
}>; }>;
export type DocumentariesQuery = { __typename?: 'Query', documentaries: { __typename: 'Documentaries', id: string, locale?: string | null, title: string, video_yt?: string | null, date: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } }; export type EditorialQuery = { __typename?: 'Query', editorial: { __typename: 'Editorial', id: string, locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, gallery?: Array<{ __typename: 'EditorialGallery', image?: string | null } | null> | null } };
export type DocumentariesConnectionQueryVariables = Exact<{ export type EditorialConnectionQueryVariables = Exact<{
before?: InputMaybe<Scalars['String']['input']>; before?: InputMaybe<Scalars['String']['input']>;
after?: InputMaybe<Scalars['String']['input']>; after?: InputMaybe<Scalars['String']['input']>;
first?: InputMaybe<Scalars['Float']['input']>; first?: InputMaybe<Scalars['Float']['input']>;
last?: InputMaybe<Scalars['Float']['input']>; last?: InputMaybe<Scalars['Float']['input']>;
sort?: InputMaybe<Scalars['String']['input']>; sort?: InputMaybe<Scalars['String']['input']>;
filter?: InputMaybe<DocumentariesFilter>; filter?: InputMaybe<EditorialFilter>;
}>; }>;
export type DocumentariesConnectionQuery = { __typename?: 'Query', documentariesConnection: { __typename?: 'DocumentariesConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'DocumentariesConnectionEdges', cursor: string, node?: { __typename: 'Documentaries', id: string, locale?: string | null, title: string, video_yt?: string | null, date: string, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string } } | null } | null> | null } }; export type EditorialConnectionQuery = { __typename?: 'Query', editorialConnection: { __typename?: 'EditorialConnection', totalCount: number, pageInfo: { __typename?: 'PageInfo', hasPreviousPage: boolean, hasNextPage: boolean, startCursor: string, endCursor: string }, edges?: Array<{ __typename?: 'EditorialConnectionEdges', cursor: string, node?: { __typename: 'Editorial', id: string, locale?: string | null, title: string, date: string, slug?: string | null, place?: string | null, country?: string | null, city?: string | null, thumbnail?: string | null, thumbnail_square?: string | null, tags?: Array<string | null> | null, youtube?: string | null, draft?: boolean | null, body?: any | null, _sys: { __typename?: 'SystemInfo', filename: string, basename: string, hasReferences?: boolean | null, breadcrumbs: Array<string>, path: string, relativePath: string, extension: string }, gallery?: Array<{ __typename: 'EditorialGallery', image?: string | null } | null> | null } | null } | null> | null } };
export const NewsPartsFragmentDoc = gql` export const NewsPartsFragmentDoc = gql`
fragment NewsParts on News { fragment NewsParts on News {
@ -480,13 +523,26 @@ export const NewsPartsFragmentDoc = gql`
body body
} }
`; `;
export const DocumentariesPartsFragmentDoc = gql` export const EditorialPartsFragmentDoc = gql`
fragment DocumentariesParts on Documentaries { fragment EditorialParts on Editorial {
__typename __typename
locale locale
title title
video_yt
date date
slug
place
country
city
thumbnail
thumbnail_square
tags
gallery {
__typename
image
}
youtube
draft
body
} }
`; `;
export const NewsDocument = gql` export const NewsDocument = gql`
@ -546,9 +602,9 @@ export const NewsConnectionDocument = gql`
} }
} }
${NewsPartsFragmentDoc}`; ${NewsPartsFragmentDoc}`;
export const DocumentariesDocument = gql` export const EditorialDocument = gql`
query documentaries($relativePath: String!) { query editorial($relativePath: String!) {
documentaries(relativePath: $relativePath) { editorial(relativePath: $relativePath) {
... on Document { ... on Document {
_sys { _sys {
filename filename
@ -561,13 +617,13 @@ export const DocumentariesDocument = gql`
} }
id id
} }
...DocumentariesParts ...EditorialParts
} }
} }
${DocumentariesPartsFragmentDoc}`; ${EditorialPartsFragmentDoc}`;
export const DocumentariesConnectionDocument = gql` export const EditorialConnectionDocument = gql`
query documentariesConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: DocumentariesFilter) { query editorialConnection($before: String, $after: String, $first: Float, $last: Float, $sort: String, $filter: EditorialFilter) {
documentariesConnection( editorialConnection(
before: $before before: $before
after: $after after: $after
first: $first first: $first
@ -597,12 +653,12 @@ export const DocumentariesConnectionDocument = gql`
} }
id id
} }
...DocumentariesParts ...EditorialParts
} }
} }
} }
} }
${DocumentariesPartsFragmentDoc}`; ${EditorialPartsFragmentDoc}`;
export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R> export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R>
export function getSdk<C>(requester: Requester<C>) { export function getSdk<C>(requester: Requester<C>) {
return { return {
@ -612,11 +668,11 @@ export type Requester<C= {}> = <R, V>(doc: DocumentNode, vars?: V, options?: C)
newsConnection(variables?: NewsConnectionQueryVariables, options?: C): Promise<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}> { newsConnection(variables?: NewsConnectionQueryVariables, options?: C): Promise<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}> {
return requester<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}, NewsConnectionQueryVariables>(NewsConnectionDocument, variables, options); return requester<{data: NewsConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: NewsConnectionQueryVariables, query: string}, NewsConnectionQueryVariables>(NewsConnectionDocument, variables, options);
}, },
documentaries(variables: DocumentariesQueryVariables, options?: C): Promise<{data: DocumentariesQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesQueryVariables, query: string}> { editorial(variables: EditorialQueryVariables, options?: C): Promise<{data: EditorialQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: EditorialQueryVariables, query: string}> {
return requester<{data: DocumentariesQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesQueryVariables, query: string}, DocumentariesQueryVariables>(DocumentariesDocument, variables, options); return requester<{data: EditorialQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: EditorialQueryVariables, query: string}, EditorialQueryVariables>(EditorialDocument, variables, options);
}, },
documentariesConnection(variables?: DocumentariesConnectionQueryVariables, options?: C): Promise<{data: DocumentariesConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesConnectionQueryVariables, query: string}> { editorialConnection(variables?: EditorialConnectionQueryVariables, options?: C): Promise<{data: EditorialConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: EditorialConnectionQueryVariables, query: string}> {
return requester<{data: DocumentariesConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: DocumentariesConnectionQueryVariables, query: string}, DocumentariesConnectionQueryVariables>(DocumentariesConnectionDocument, variables, options); return requester<{data: EditorialConnectionQuery, errors?: { message: string, locations: { line: number, column: number }[], path: string[] }[], variables: EditorialConnectionQueryVariables, query: string}, EditorialConnectionQueryVariables>(EditorialConnectionDocument, variables, options);
} }
}; };
} }

View File

@ -128,10 +128,21 @@ export default defineConfig({
], ],
}, },
{ {
name: "documentaries", name: "editorial",
label: "Documentaries", label: "Editorial",
path: "src/content/documentaries", path: "src/content/editorial",
format: "md", format: "md",
match: {
include: "**/*",
},
ui: {
filename: {
readonly: false,
slugify: (values) => {
return values?.slug?.toLowerCase() || values?.title?.toLowerCase().replace(/ /g, '-');
},
},
},
fields: [ fields: [
{ {
type: "string", type: "string",
@ -142,6 +153,7 @@ export default defineConfig({
{ label: "English", value: "en" }, { label: "English", value: "en" },
{ label: "Português", value: "pt" }, { label: "Português", value: "pt" },
{ label: "Kinyarwanda", value: "rw" }, { label: "Kinyarwanda", value: "rw" },
{ label: "Frances", value: "fr" }
], ],
}, },
{ {
@ -151,18 +163,78 @@ export default defineConfig({
isTitle: true, isTitle: true,
required: true, required: true,
}, },
{
type: "string",
name: "video_yt",
label: "YouTube ID",
},
{ {
type: "datetime", type: "datetime",
name: "date", name: "date",
label: "Date", label: "Date",
required: true, required: true,
}, },
] {
type: "string",
name: "slug",
label: "Slug",
},
{
type: "string",
name: "place",
label: "Place",
},
{
type: "string",
name: "country",
label: "Country",
},
{
type: "string",
name: "city",
label: "City",
},
{
type: "image",
name: "thumbnail",
label: "Thumbnail URL",
},
{
type: "image",
name: "thumbnail_square",
label: "Thumbnail Square URL",
},
{
type: "string",
name: "tags",
label: "Tags",
list: true,
},
{
type: "object",
name: "gallery",
label: "Gallery",
list: true,
fields: [
{
type: "image",
name: "image",
label: "Image",
},
],
},
{
type: "string",
name: "youtube",
label: "YouTube ID",
},
{
type: "boolean",
name: "draft",
label: "Draft",
},
{
type: "rich-text",
name: "body",
label: "Content",
isBody: true,
},
],
}, },
], ],
}, },

File diff suppressed because one or more lines are too long