From 626bc1c4c46e8063332daae9dd738f7df4f566d4 Mon Sep 17 00:00:00 2001 From: Daveed Date: Tue, 30 Sep 2025 21:32:14 -0400 Subject: [PATCH 1/7] Reading store.settings --- src/content/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/config.ts b/src/content/config.ts index 45e6753..c806cb1 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -58,7 +58,7 @@ const store = defineCollection({ loader: strapiLoader({ contentType: "store", filter: `filters[slug][$eq]=${config.store_slug}`, - populate: 'SEO.socialImage,Logo,URLS,Favicon,Cover' + populate: 'SEO.socialImage,Logo,URLS,Favicon,Cover,settings' }) as Loader, }); From 79b91ae02c6100c4e0bcead6009f65b849576867 Mon Sep 17 00:00:00 2001 From: Daveed Date: Wed, 1 Oct 2025 00:36:47 -0400 Subject: [PATCH 2/7] layout loads head_scripts if present --- src/content/config.ts | 18 ++++++++++++------ src/layouts/Layout.astro | 24 +++++++++++++++++++----- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/content/config.ts b/src/content/config.ts index c806cb1..c4ee78f 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -53,13 +53,19 @@ const pages = defineCollection({ }) as Loader, }); - const store = defineCollection({ - loader: strapiLoader({ - contentType: "store", - filter: `filters[slug][$eq]=${config.store_slug}`, - populate: 'SEO.socialImage,Logo,URLS,Favicon,Cover,settings' - }) as Loader, + loader: { + name: `strapi-store-info`, + schema: async () => await fetchStrapiSchema('store', config.api_url), + load: async ({ store, logger, meta }) => { + logger.info('fetch:store:info'); + const data = await fetch(new URL(`/api/stores/${config.store_slug}/info`, config.api_url)); + const posts = await data?.json(); + store.clear(); + posts?.data.forEach((item: any) => store.set({ id: item.id, data: item })); + meta.set("lastSynced", String(Date.now()));; + } + } as Loader, }); const stores = defineCollection({ diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 6f86c73..d64acab 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -9,6 +9,11 @@ export interface Props { favicon?: string; } +import { getCollection } from "astro:content"; + +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; + const { title, canonical, description, keywords, author, ogImage, favicon } = Astro.props; --- @@ -60,18 +65,27 @@ const { title, canonical, description, keywords, author, ogImage, favicon } = rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" /> + + { + store?.settings?.meta?.head_scripts?.map( + (script: { url: string; defer: boolean }) => ( + + > - - + + + + - diff --git a/src/pages/about.astro b/src/pages/about.astro new file mode 100644 index 0000000..0bad9e5 --- /dev/null +++ b/src/pages/about.astro @@ -0,0 +1,155 @@ +--- +import Layout from "../layouts/Layout.astro"; +import SimpleNavbar from "../components/simpleNavbar"; +import SimpleFooter from "../components/simpleFooter"; + +import { getCollection } from "astro:content"; + +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; +const storeName = store.title || "Markkët Express"; +const storeDescription = + store.Description || + "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos. Ejemplos, tutoriales y documentación en español."; +const storeLogo = store.Logo?.url || ""; +const storeSEO = store.SEO || {}; +--- + + + + + +
+ +
+
+
+
+

Acerca de {storeName}

+

+ Conoce nuestra historia, misión y el equipo detrás de {storeName} +

+
+
+
+
+ +
+ +
+
+
+

Nuestra Historia

+

+ {storeName} nació con la misión de ofrecer productos y servicios de la más alta calidad + a nuestros clientes. Desde nuestros humildes comienzos, hemos crecido hasta convertirnos + en una empresa líder en nuestro sector. +

+

+ Nos especializamos en brindar soluciones innovadoras que satisfacen las necesidades + cambiantes de nuestros clientes, siempre manteniendo nuestros valores fundamentales + de calidad, confiabilidad y excelencia en el servicio. +

+
+
+ Nuestro equipo trabajando +
+
+
+ + +
+
+
+
+ +

Nuestra Misión

+

+ Proporcionar productos y servicios excepcionales que superen las expectativas + de nuestros clientes, mientras construimos relaciones duraderas basadas en + la confianza y la excelencia. +

+
+
+
+
+ +

Nuestra Visión

+

+ Ser reconocidos como la empresa líder en nuestro sector, conocida por + nuestra innovación, calidad y compromiso inquebrantable con la satisfacción + del cliente. +

+
+
+
+
+ + +
+
+

Nuestros Valores

+

Los principios que guían todo lo que hacemos

+
+
+
+
+ +

Pasión

+

+ Nos apasiona lo que hacemos y se refleja en cada producto y servicio que ofrecemos. +

+
+
+
+
+ +

Integridad

+

+ Actuamos con honestidad y transparencia en todas nuestras relaciones comerciales. +

+
+
+
+
+ +

Innovación

+

+ Buscamos constantemente nuevas formas de mejorar y evolucionar nuestros servicios. +

+
+
+
+
+ + +
+
+

¿Quieres saber más?

+

+ Estamos aquí para responder cualquier pregunta que puedas tener sobre {storeName} + y nuestros productos y servicios. +

+ + + Contáctanos + +
+
+
+
+ + + +
\ No newline at end of file diff --git a/src/pages/blog.astro b/src/pages/blog.astro new file mode 100644 index 0000000..4389148 --- /dev/null +++ b/src/pages/blog.astro @@ -0,0 +1,245 @@ +--- +import Layout from "../layouts/Layout.astro"; +import SimpleNavbar from "../components/simpleNavbar"; +import SimpleFooter from "../components/simpleFooter"; + +import { getCollection } from "astro:content"; + +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; +const storeName = store.title || "Markkët Express"; +const storeDescription = + store.Description || + "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos."; +const storeLogo = store.Logo?.url || ""; +const storeSEO = store.SEO || {}; + +// Sample blog posts - later this would come from your CMS +const blogPosts = [ + { + id: 1, + title: "Cómo elegir el producto perfecto para ti", + excerpt: "Descubre los factores clave que debes considerar al elegir productos que se adapten a tus necesidades y estilo de vida.", + image: "https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80", + author: "Equipo Markkët", + date: "2024-10-01", + category: "Guías", + readTime: "5 min" + }, + { + id: 2, + title: "Tendencias 2024: Lo que está de moda", + excerpt: "Explora las últimas tendencias y descubre qué estilos dominarán este año en el mundo de la moda y los productos.", + image: "https://images.unsplash.com/photo-1441986300917-64674bd600d8?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80", + author: "María González", + date: "2024-09-28", + category: "Tendencias", + readTime: "7 min" + }, + { + id: 3, + title: "Cuidado y mantenimiento de tus productos", + excerpt: "Aprende las mejores prácticas para mantener tus productos en perfecto estado y prolongar su vida útil.", + image: "https://images.unsplash.com/photo-1558618047-3c8c76ca7d13?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80", + author: "Carlos Rodríguez", + date: "2024-09-25", + category: "Tips", + readTime: "6 min" + } +]; +--- + + + + + +
+ +
+
+
+
+

Blog de {storeName}

+

+ Descubre consejos, tendencias y noticias del mundo de nuestros productos +

+
+
+
+
+ +
+ +
+
+
+ {blogPosts[0].title} +
+
+
{blogPosts[0].category}
+

{blogPosts[0].title}

+

{blogPosts[0].excerpt}

+
+ + {blogPosts[0].author} + + {blogPosts[0].date} + + {blogPosts[0].readTime} +
+ + Leer Artículo + + +
+
+
+ + +
+
+
+

Últimos Artículos

+
+
+
+ + + + +
+
+
+ +
+ { + blogPosts.slice(1).map((post) => ( +
+
+ {post.title} +
+
+ {post.category} +
+
{post.title}
+

{post.excerpt}

+
+ + {post.author} + + {post.readTime} +
+ + Leer Más + +
+
+
+ )) + } +
+
+ + +
+
+

¿No te quieres perder nada?

+

+ Suscríbete a nuestro boletín y recibe los últimos artículos directamente en tu inbox +

+
+
+
+ + +
+
+
+
+
+ + +
+
+

Explora por Categorías

+
+
+
+
+ +
Guías
+

Consejos prácticos y tutoriales

+ Ver Guías +
+
+
+
+ +
Tendencias
+

Lo último en moda y estilo

+ Ver Tendencias +
+
+
+
+ +
Tips
+

Consejos útiles y trucos

+ Ver Tips +
+
+
+
+ +
Noticias
+

Últimas novedades

+ Ver Noticias +
+
+
+
+
+
+ + + +
+ + \ No newline at end of file diff --git a/src/pages/contact.astro b/src/pages/contact.astro new file mode 100644 index 0000000..0158045 --- /dev/null +++ b/src/pages/contact.astro @@ -0,0 +1,258 @@ +--- +import Layout from "../layouts/Layout.astro"; +import SimpleNavbar from "../components/simpleNavbar"; +import SimpleFooter from "../components/simpleFooter"; + +import { getCollection } from "astro:content"; + +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; +const storeName = store.title || "Markkët Express"; +const storeDescription = + store.Description || + "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos."; +const storeLogo = store.Logo?.url || ""; +const storeSEO = store.SEO || {}; +--- + + + + + +
+ +
+
+
+
+

Contáctanos

+

+ Estamos aquí para ayudarte. No dudes en ponerte en contacto con nosotros +

+
+
+
+
+ +
+
+ +
+
+

Envíanos un mensaje

+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+ + +
+
+ +
+

Información de Contacto

+ +
+
+ + Dirección +
+

+ 123 Calle Principal
+ Ciudad, País 12345 +

+
+ +
+
+ + Teléfono +
+

+1 (555) 123-4567

+
+ +
+
+ + Email +
+

{store?.settings?.support_email}

+
+ +
+
+ + Horario +
+

+ Lun - Vie: 9:00 AM - 6:00 PM
+ Sáb: 10:00 AM - 4:00 PM
+ Dom: Cerrado +

+
+
+ + +
+
Síguenos
+ +
+
+
+
+ + +
+
+

Preguntas Frecuentes

+

Quizás encuentres la respuesta a tu pregunta aquí

+
+
+
+
+
+

+ +

+
+
+ Aceptamos tarjetas de crédito y débito (Visa, MasterCard, American Express), PayPal, + transferencias bancarias y pagos en efectivo para entregas locales. +
+
+
+
+

+ +

+
+
+ Los envíos locales tardan de 1-3 días laborables, envíos nacionales de 3-7 días laborables, + y envíos internacionales de 7-15 días laborables dependiendo del destino. +
+
+
+
+

+ +

+
+
+ Sí, aceptamos devoluciones dentro de los 30 días posteriores a la compra. + El producto debe estar en condiciones originales y con el empaque original. +
+
+
+
+
+
+
+
+
+ + + +
+ + \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 00d1dac..816e41f 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,13 +1,9 @@ --- import Layout from "../layouts/Layout.astro"; import data from "../../public/data.json"; -import "../../assets/scss/astro-ecommerce.scss"; -import ComplexNavbar from "../components/complexNavbar"; -import ComplexFooter from "../components/complexFooter"; +import SimpleNavbar from "../components/simpleNavbar"; +import SimpleFooter from "../components/simpleFooter"; import CardProduct from "../components/products/cardProduct"; -import CardCategory from "../components/products/cardCategory"; -import TestimonialsFade from "../components/promo/testimonialsFade"; -import IncentiveCols from "../components/incentives/incentiveCols"; import { getCollection } from "astro:content"; @@ -22,16 +18,6 @@ const storeCover = store.Cover?.url || ""; const storeSEO = store.SEO || {}; --- - - -
- - + + - +
+
-
+
{ storeLogo && ( {`${storeName} ) } -

{storeName}

-

{storeDescription}

-
@@ -85,12 +69,12 @@ const storeSEO = store.SEO || {};
-
+
-

Productos Destacados

+

Productos Destacados

Descubre nuestros artículos más populares

@@ -114,99 +98,51 @@ const storeSEO = store.SEO || {}; )) }
-
- - -
-
-
-

Comprar por Categoría

-

Encuentra exactamente lo que buscas

-
-
-
- { - data.categories.slice(0, 4).map((category) => ( -
- -
- )) - } -
- -
- -
- - -
-
-
-

¿Por qué elegir {storeName}?

-

- Estamos comprometidos a brindar la mejor experiencia de compra -

-
-
- -
- - +
-
-
-
-

Acerca de {storeName}

-

{storeDescription}

-
-
-
- -
Confiable
- Seguro y confiable -
-
-
-
- -
Envío Rápido
- Entrega rápida -
-
-
-
- -
Calidad
- Productos premium -
-
+
+
+

¿Por qué elegir {storeName}?

+

{storeDescription}

+
+
+ +
Confiable
+ Seguro y confiable +
+
+ +
Envío Rápido
+ Entrega rápida
+
+ +
Calidad
+ Productos premium +
+
+
- - -
+ + + diff --git a/src/pages/servicios.astro b/src/pages/servicios.astro new file mode 100644 index 0000000..b0a07e0 --- /dev/null +++ b/src/pages/servicios.astro @@ -0,0 +1,158 @@ +--- +import Layout from "../layouts/Layout.astro"; +import SimpleNavbar from "../components/simpleNavbar"; +import SimpleFooter from "../components/simpleFooter"; +import CardProduct from "../components/products/cardProduct"; +import data from "../../public/data.json"; + +import { getCollection } from "astro:content"; + +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; +const storeName = store.title || "Markkët Express"; +const storeDescription = + store.Description || + "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos."; +const storeLogo = store.Logo?.url || ""; +const storeSEO = store.SEO || {}; +--- + + + + + +
+ +
+
+
+
+

Nuestros Productos

+

+ Descubre nuestra amplia gama de productos de alta calidad +

+
+
+
+
+ +
+ +
+
+
+
Mostrando {data.products.length} productos
+
+
+
+ + + + +
+
+
+
+ + +
+
+ { + data.products.map((product) => ( +
+ +
+ )) + } +
+
+ + +
+
+

Categorías

+

Explora nuestros productos por categoría

+
+
+ { + data.categories.map((category) => ( +
+
+ {category.title} +
+
{category.title}
+

{category.collection}

+ +
+
+
+ )) + } +
+
+ + +
+
+

¿Quieres ser el primero en saber sobre nuevos productos?

+

+ Suscríbete a nuestro boletín y mantente al día con las últimas novedades +

+
+
+
+ + +
+
+
+
+
+
+
+ + + +
+ + \ No newline at end of file From 9c2460806e939d99fde649200c6f2d7ba9d00a0d Mon Sep 17 00:00:00 2001 From: Daveed Date: Sun, 5 Oct 2025 19:10:01 -0400 Subject: [PATCH 4/7] drafting /about page --- src/components/blocks.content.astro | 353 ++++++++++++++++++ src/components/simpleFooter.tsx | 2 +- src/components/simpleNavbar.tsx | 2 +- src/layouts/BasicLayout.astro | 47 +++ src/pages/about.astro | 155 -------- src/pages/about/[slug].astro | 5 + src/pages/about/index.astro | 104 ++++++ ...erce.astro => astro-ecommerce.draft.astro} | 0 src/pages/{contact.astro => contacto.astro} | 0 src/pages/receipt.astro | 4 + src/pages/servicios/[slug].astro | 4 + .../index.astro} | 0 src/types.d.ts | 39 ++ 13 files changed, 558 insertions(+), 157 deletions(-) create mode 100644 src/components/blocks.content.astro create mode 100644 src/layouts/BasicLayout.astro delete mode 100644 src/pages/about.astro create mode 100644 src/pages/about/[slug].astro create mode 100644 src/pages/about/index.astro rename src/pages/{astro-ecommerce.astro => astro-ecommerce.draft.astro} (100%) rename src/pages/{contact.astro => contacto.astro} (100%) create mode 100644 src/pages/receipt.astro create mode 100644 src/pages/servicios/[slug].astro rename src/pages/{servicios.astro => servicios/index.astro} (100%) create mode 100644 src/types.d.ts diff --git a/src/components/blocks.content.astro b/src/components/blocks.content.astro new file mode 100644 index 0000000..955b427 --- /dev/null +++ b/src/components/blocks.content.astro @@ -0,0 +1,353 @@ +--- +import { type ContentBlock } from "../types.d"; + +export interface Props { + content?: ContentBlock[]; + className?: string; +} + +const { content, className = "" } = Astro.props; +--- + +{ + content && content.length > 0 && ( +
+ {content.map((block) => ( + + {/* Paragraph blocks */} + {block.type === "paragraph" && ( +

+ {block.children.map((child) => ( + + {child.code && ( + + {child.text} + + )} + {child.type === "link" && !child.code && ( + + {child.children?.[0]?.text || child.text} + + )} + {!child.code && + child.type !== "link" && + (child.bold ? ( + {child.text} + ) : ( + {child.text} + ))} + + ))} +

+ )} + + {/* Heading blocks */} + {block.type === "heading" && block.level === 1 && ( +

+ {block.children.map((child) => ( + + {child.code ? ( + + {child.text} + + ) : child.type === "link" ? ( + + {child.children?.[0]?.text || child.text} + + ) : ( + {child.text} + )} + + ))} +

+ )} + + {block.type === "heading" && block.level === 2 && ( +

+ {block.children.map((child) => ( + + {child.code ? ( + + {child.text} + + ) : child.type === "link" ? ( + + {child.children?.[0]?.text || child.text} + + ) : ( + {child.text} + )} + + ))} +

+ )} + + {block.type === "heading" && block.level === 3 && ( +

+ {block.children.map((child) => ( + + {child.code ? ( + + {child.text} + + ) : child.type === "link" ? ( + + {child.children?.[0]?.text || child.text} + + ) : ( + {child.text} + )} + + ))} +

+ )} + + {block.type === "heading" && (block.level === 4 || !block.level) && ( +

+ {block.children.map((child) => ( + + {child.code ? ( + + {child.text} + + ) : child.type === "link" ? ( + + {child.children?.[0]?.text || child.text} + + ) : ( + {child.text} + )} + + ))} +

+ )} + + {block.type === "heading" && block.level === 5 && ( +
+ {block.children.map((child) => ( + + {child.code ? ( + + {child.text} + + ) : child.type === "link" ? ( + + {child.children?.[0]?.text || child.text} + + ) : ( + {child.text} + )} + + ))} +
+ )} + + {block.type === "heading" && block.level === 6 && ( +
+ {block.children.map((child) => ( + + {child.code ? ( + + {child.text} + + ) : child.type === "link" ? ( + + {child.children?.[0]?.text || child.text} + + ) : ( + {child.text} + )} + + ))} +
+ )} + + {/* Code blocks */} + {block.type === "code" && ( +
+
+                
+                  {block.children
+                    .map((child) => (child.code ? child.text : ""))
+                    .filter(Boolean)
+                    .join("\n")}
+                
+              
+
+ )} + + {/* List blocks */} + {block.type === "list" && ( +
    + {block.children + .filter((child) => child.type === "list-item") + .map((child) => ( +
  • + {child.children?.map((grandChild: any) => ( + + {grandChild.type === "link" ? ( + + {grandChild.text} + + ) : ( + {grandChild.text} + )} + + ))} +
  • + ))} +
+ )} + + {/* Quote blocks */} + {block.type === "quote" && ( +
+
+ {block.children.map((child) => ( + + {child.code ? ( + + {child.text} + + ) : child.type === "link" ? ( + + {child.children?.[0]?.text || child.text} + + ) : ( + {child.text} + )} + + ))} +
+
+ )} + + {/* Image blocks */} + {block.type === "image" && block.image?.url && ( +
+
+ { +
+ {((block.image as any).caption || + (block.image as any).alternativeText || + (block.image as any).name) && ( +
+ {(block.image as any).caption || + (block.image as any).alternativeText || + (block.image as any).name} +
+ )} +
+ )} +
+ ))} +
+ ) +} + + diff --git a/src/components/simpleFooter.tsx b/src/components/simpleFooter.tsx index 51624b3..839e6d9 100644 --- a/src/components/simpleFooter.tsx +++ b/src/components/simpleFooter.tsx @@ -71,7 +71,7 @@ const SimpleFooter: React.FC = ({ store = {} }) => {
Soporte
    -
  • Contacto
  • +
  • Contacto
  • Ayuda
  • Términos
  • Privacidad
  • diff --git a/src/components/simpleNavbar.tsx b/src/components/simpleNavbar.tsx index 9a18d1c..24f2f3b 100644 --- a/src/components/simpleNavbar.tsx +++ b/src/components/simpleNavbar.tsx @@ -64,7 +64,7 @@ const SimpleNavbar: React.FC = ({ storeName = "Markkët Expre
  • - + Contacto diff --git a/src/layouts/BasicLayout.astro b/src/layouts/BasicLayout.astro new file mode 100644 index 0000000..a9595f0 --- /dev/null +++ b/src/layouts/BasicLayout.astro @@ -0,0 +1,47 @@ +--- +import Layout from "./Layout.astro"; +import SimpleNavbar from "../components/simpleNavbar"; +import SimpleFooter from "../components/simpleFooter"; +import { getCollection } from "astro:content"; + +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; +const storeName = store.title || "Markkët Express"; +const storeDescription = + store.Description || + "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos. Ejemplos, tutoriales y documentación en español."; +const storeLogo = store.Logo?.url || ""; +const storeSEO = store.SEO || {}; + +export interface Props { + title: string; + canonical?: string; + description?: string; + keywords?: string; + author?: string; + ogImage?: string; + favicon?: string; +} + +const { title, canonical, description, keywords, author, ogImage, favicon } = + Astro.props; +--- + + + + + +
    + +
    + + +
    diff --git a/src/pages/about.astro b/src/pages/about.astro deleted file mode 100644 index 0bad9e5..0000000 --- a/src/pages/about.astro +++ /dev/null @@ -1,155 +0,0 @@ ---- -import Layout from "../layouts/Layout.astro"; -import SimpleNavbar from "../components/simpleNavbar"; -import SimpleFooter from "../components/simpleFooter"; - -import { getCollection } from "astro:content"; - -const storeData = await getCollection("store"); -const store = storeData[0]?.data || {}; -const storeName = store.title || "Markkët Express"; -const storeDescription = - store.Description || - "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos. Ejemplos, tutoriales y documentación en español."; -const storeLogo = store.Logo?.url || ""; -const storeSEO = store.SEO || {}; ---- - - - - - -
    - -
    -
    -
    -
    -

    Acerca de {storeName}

    -

    - Conoce nuestra historia, misión y el equipo detrás de {storeName} -

    -
    -
    -
    -
    - -
    - -
    -
    -
    -

    Nuestra Historia

    -

    - {storeName} nació con la misión de ofrecer productos y servicios de la más alta calidad - a nuestros clientes. Desde nuestros humildes comienzos, hemos crecido hasta convertirnos - en una empresa líder en nuestro sector. -

    -

    - Nos especializamos en brindar soluciones innovadoras que satisfacen las necesidades - cambiantes de nuestros clientes, siempre manteniendo nuestros valores fundamentales - de calidad, confiabilidad y excelencia en el servicio. -

    -
    -
    - Nuestro equipo trabajando -
    -
    -
    - - -
    -
    -
    -
    - -

    Nuestra Misión

    -

    - Proporcionar productos y servicios excepcionales que superen las expectativas - de nuestros clientes, mientras construimos relaciones duraderas basadas en - la confianza y la excelencia. -

    -
    -
    -
    -
    - -

    Nuestra Visión

    -

    - Ser reconocidos como la empresa líder en nuestro sector, conocida por - nuestra innovación, calidad y compromiso inquebrantable con la satisfacción - del cliente. -

    -
    -
    -
    -
    - - -
    -
    -

    Nuestros Valores

    -

    Los principios que guían todo lo que hacemos

    -
    -
    -
    -
    - -

    Pasión

    -

    - Nos apasiona lo que hacemos y se refleja en cada producto y servicio que ofrecemos. -

    -
    -
    -
    -
    - -

    Integridad

    -

    - Actuamos con honestidad y transparencia en todas nuestras relaciones comerciales. -

    -
    -
    -
    -
    - -

    Innovación

    -

    - Buscamos constantemente nuevas formas de mejorar y evolucionar nuestros servicios. -

    -
    -
    -
    -
    - - -
    -
    -

    ¿Quieres saber más?

    -

    - Estamos aquí para responder cualquier pregunta que puedas tener sobre {storeName} - y nuestros productos y servicios. -

    - - - Contáctanos - -
    -
    -
    -
    - - - -
    \ No newline at end of file diff --git a/src/pages/about/[slug].astro b/src/pages/about/[slug].astro new file mode 100644 index 0000000..43d1a69 --- /dev/null +++ b/src/pages/about/[slug].astro @@ -0,0 +1,5 @@ +--- +--- +
    + Hola +
    \ No newline at end of file diff --git a/src/pages/about/index.astro b/src/pages/about/index.astro new file mode 100644 index 0000000..79ade39 --- /dev/null +++ b/src/pages/about/index.astro @@ -0,0 +1,104 @@ +--- +import Layout from "../../layouts/BasicLayout.astro"; +import BlocksContent from "../../components/blocks.content.astro"; +import { getCollection } from "astro:content"; + +const pages = await getCollection("pages"); +const pageEntry = pages.find((p) => p.data.slug === "about"); +const page = pageEntry?.data || null; +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; +--- + + +
    +
    +
    +
    +
    +

    {page?.Title || "Acerca de"}

    + { + page?.SEO?.metaDescription && ( +

    {page.SEO.metaDescription}

    + ) + } +
    +
    +
    +
    + +
    + { + page?.Content ? ( + + ) : ( +
    +
    +

    + No hay contenido disponible para esta página. +

    +
    +
    + ) + } +
    +
    +
    +

    Nuestros Valores

    +

    Principios que nos guian

    +
    +
    +
    +
    + +

    Pasión

    +

    + Nos apasiona lo que hacemos y se refleja en cada producto y + servicio que ofrecemos. +

    +
    +
    +
    +
    + +

    Integridad

    +

    + Actuamos con honestidad y transparencia en todas nuestras + relaciones comerciales. +

    +
    +
    +
    +
    + +

    Innovación

    +

    + Buscamos constantemente nuevas formas de mejorar y evolucionar + nuestros servicios. +

    +
    +
    +
    +
    +
    +
    +

    ¿Quieres saber más?

    +

    + Estamos aquí para responder cualquier pregunta que puedas tener sobre { + store?.title + }, nuestros productos y servicios. +

    + + + Contáctanos + +
    +
    +
    +
    diff --git a/src/pages/astro-ecommerce.astro b/src/pages/astro-ecommerce.draft.astro similarity index 100% rename from src/pages/astro-ecommerce.astro rename to src/pages/astro-ecommerce.draft.astro diff --git a/src/pages/contact.astro b/src/pages/contacto.astro similarity index 100% rename from src/pages/contact.astro rename to src/pages/contacto.astro diff --git a/src/pages/receipt.astro b/src/pages/receipt.astro new file mode 100644 index 0000000..30cc84d --- /dev/null +++ b/src/pages/receipt.astro @@ -0,0 +1,4 @@ +--- +--- + +
    Transacción
    diff --git a/src/pages/servicios/[slug].astro b/src/pages/servicios/[slug].astro new file mode 100644 index 0000000..bb1b638 --- /dev/null +++ b/src/pages/servicios/[slug].astro @@ -0,0 +1,4 @@ +--- +--- + +
    Servicios
    diff --git a/src/pages/servicios.astro b/src/pages/servicios/index.astro similarity index 100% rename from src/pages/servicios.astro rename to src/pages/servicios/index.astro diff --git a/src/types.d.ts b/src/types.d.ts new file mode 100644 index 0000000..982a94b --- /dev/null +++ b/src/types.d.ts @@ -0,0 +1,39 @@ +interface BlockText { + text: string; + type?: 'text'; + bold?: boolean; +} + +interface BlockLink { + type: 'link'; + url: string; + children: BlockText[]; +} + +type BlockChild = BlockText | BlockLink; + +export interface ContentBlock { + type: 'paragraph' | 'heading' | 'list' | 'list-item' | 'image' | 'link' | 'quote' | 'code'; + type: string; + level?: number; + image?: { + url: string; + formats?: { + thumbnail?: { url: string }; + small?: { url: string }; + medium?: { url: string }; + large?: { url: string }; + }; + width: number; + height: number; + name: string; + }, + children: Array<{ + type: string; + code?: boolean; + text?: string; + bold?: boolean; + url?: string; + children?: Array<{ text: string; type: string; }>; + }>; +} \ No newline at end of file From 0543e75aab584aa66aca31c8c83ac9dc81e87eaa Mon Sep 17 00:00:00 2001 From: Daveed Date: Tue, 7 Oct 2025 12:29:44 -0400 Subject: [PATCH 5/7] draft for about/slug --- src/components/blocks.content.astro | 6 +- src/components/markket/pages.cards.astro | 60 ++++++++++++++ src/pages/about/[slug].astro | 100 ++++++++++++++++++++++- src/pages/about/index.astro | 15 ++++ src/pages/index.astro | 32 +++++--- 5 files changed, 194 insertions(+), 19 deletions(-) create mode 100644 src/components/markket/pages.cards.astro diff --git a/src/components/blocks.content.astro b/src/components/blocks.content.astro index 955b427..632a034 100644 --- a/src/components/blocks.content.astro +++ b/src/components/blocks.content.astro @@ -13,7 +13,7 @@ const { content, className = "" } = Astro.props; content && content.length > 0 && (
    {content.map((block) => ( - + <> {/* Paragraph blocks */} {block.type === "paragraph" && (

    @@ -291,7 +291,7 @@ const { content, className = "" } = Astro.props; {((block.image as any).caption || (block.image as any).alternativeText || (block.image as any).name) && ( -

    +
    {(block.image as any).caption || (block.image as any).alternativeText || (block.image as any).name} @@ -299,7 +299,7 @@ const { content, className = "" } = Astro.props; )} )} - + ))}
    ) diff --git a/src/components/markket/pages.cards.astro b/src/components/markket/pages.cards.astro new file mode 100644 index 0000000..498f3c0 --- /dev/null +++ b/src/components/markket/pages.cards.astro @@ -0,0 +1,60 @@ +--- +/** + * pages: Array of either collection entries or raw page data objects + * Each item may be: { id, data } or the direct data object. + */ +const { pages = [], className = '' } = Astro.props; + +const href = (slug: string) => { + const map = { + home: '/', + blog: '/blog', + newsletter: '/newsletter', + contact: '/contacto', + about: '/about' + } + + return map[slug] || `/about/${slug}`; +} +--- + +
    + {pages.map((entry: any) => { + const p = entry?.data ? entry.data : entry; + const title = p?.Title || p?.title || 'Untitled'; + const slug = p?.slug || p?.Slug || p?.id || ''; + const img = p?.Cover?.url || p?.SEO?.socialImage?.url || ''; + const desc = p?.SEO?.metaDescription || (p?.Content && p.Content[0]?.children?.[0]?.text) || ''; + + return ( + + ); + })} +
    + + diff --git a/src/pages/about/[slug].astro b/src/pages/about/[slug].astro index 43d1a69..6bb991d 100644 --- a/src/pages/about/[slug].astro +++ b/src/pages/about/[slug].astro @@ -1,5 +1,99 @@ --- +import Layout from "../../layouts/BasicLayout.astro"; +import BlocksContent from "../../components/blocks.content.astro"; +import PageCards from "../../components/markket/pages.cards.astro"; +import { getCollection } from "astro:content"; + +export async function getStaticPaths() { + const pages = await getCollection("pages"); + + // Filter pages that should appear under /about + const aboutPages = pages.filter((p) => { + const slug = p.data?.slug || p.id; + if (!slug) return false; + // skip the index/about home or obvious root pages + if (slug === "about" || slug === "home") return false; + const pd = p.data as any; + // skip pages that point to external URLs + if (pd?.ExternalUrl) return false; + // allow an explicit opt-out via ShowInAbout = false + if (pd?.ShowInAbout === false) return false; + // if a Section field exists, only include pages explicitly in the 'about' section + if (pd?.Section && String(pd?.Section).toLowerCase() !== "about") + return false; + return true; + }); + + return aboutPages.map((p) => ({ params: { slug: p.data?.slug || p.id } })); +} + +const pages = await getCollection("pages"); + +const { slug } = Astro.params; +const current = pages.find((p) => p.data?.slug === slug || p.id === slug); +if (!current) throw new Error(`Page not found: ${slug}`); + +const relatedPages = pages.filter( + (p) => ![slug, "home", "about"].includes(p.data?.slug) +); + +const page = current.data; + +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; --- -
    - Hola -
    \ No newline at end of file + + +
    + +
    +
    +
    +
    +

    {page?.Title || "Acerca de"}

    + { + page?.SEO?.metaDescription ? ( +

    {page.SEO.metaDescription}

    + ) : ( +

    + Conoce más sobre nosotros y lo que hacemos. +

    + ) + } +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +

    Paginas relacionadas

    +
    +
    +
    + +
    +
    +
    +
    diff --git a/src/pages/about/index.astro b/src/pages/about/index.astro index 79ade39..bcbc588 100644 --- a/src/pages/about/index.astro +++ b/src/pages/about/index.astro @@ -2,12 +2,16 @@ import Layout from "../../layouts/BasicLayout.astro"; import BlocksContent from "../../components/blocks.content.astro"; import { getCollection } from "astro:content"; +import PageCards from "../../components/markket/pages.cards.astro"; const pages = await getCollection("pages"); const pageEntry = pages.find((p) => p.data.slug === "about"); const page = pageEntry?.data || null; const storeData = await getCollection("store"); const store = storeData[0]?.data || {}; +const relatedPages = pages.filter( + (p) => !["home", "about"].includes(p.data?.slug) +); ---
+ +
+
+
+

Paginas relacionadas

+
+
+
+ +
+
diff --git a/src/pages/index.astro b/src/pages/index.astro index 816e41f..d921b5f 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -4,6 +4,7 @@ import data from "../../public/data.json"; import SimpleNavbar from "../components/simpleNavbar"; import SimpleFooter from "../components/simpleFooter"; import CardProduct from "../components/products/cardProduct"; +import PageCards from "../components/markket/pages.cards.astro"; import { getCollection } from "astro:content"; @@ -16,6 +17,7 @@ const storeDescription = const storeLogo = store.Logo?.url || ""; const storeCover = store.Cover?.url || ""; const storeSEO = store.SEO || {}; +const pages = (await getCollection("pages"))?.splice(0, 2); --- {storeName}

{storeDescription}

-
-

¿Por qué elegir {storeName}?

+

Conoce a {storeName}

{storeDescription}

@@ -130,16 +131,21 @@ const storeSEO = store.SEO || {}; Productos premium
-
+ +
+
+
+

Acerca de Nosostros

+
+
+
+ +
+
From e7f20297fb46cea56575be2b53f0d121b50c6337 Mon Sep 17 00:00:00 2001 From: Daveed Date: Tue, 7 Oct 2025 15:15:50 -0400 Subject: [PATCH 6/7] draft for servicios --- .gitignore | 1 + src/components/markket/pages.cards.astro | 111 ++++-- src/components/products/cardProduct.tsx | 66 ---- src/components/products/categoryFilters.tsx | 10 +- src/components/products/product.cards.tsx | 20 + src/components/simpleFooter.tsx | 17 +- src/pages/astro-ecommerce.draft.astro | 386 -------------------- src/pages/index.astro | 33 +- src/pages/product.astro | 55 +-- src/pages/servicios/[slug].astro | 58 ++- src/pages/servicios/index.astro | 140 ++----- src/pages/shopping-cart.astro | 57 +-- 12 files changed, 256 insertions(+), 698 deletions(-) delete mode 100644 src/components/products/cardProduct.tsx create mode 100644 src/components/products/product.cards.tsx delete mode 100644 src/pages/astro-ecommerce.draft.astro diff --git a/.gitignore b/.gitignore index 05c42ec..1bdf880 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ package-lock.json .astro/ *.local *.backup +*.draft.* \ No newline at end of file diff --git a/src/components/markket/pages.cards.astro b/src/components/markket/pages.cards.astro index 498f3c0..398d994 100644 --- a/src/components/markket/pages.cards.astro +++ b/src/components/markket/pages.cards.astro @@ -3,58 +3,89 @@ * pages: Array of either collection entries or raw page data objects * Each item may be: { id, data } or the direct data object. */ -const { pages = [], className = '' } = Astro.props; +const { pages = [], className = "" } = Astro.props; const href = (slug: string) => { - const map = { - home: '/', - blog: '/blog', - newsletter: '/newsletter', - contact: '/contacto', - about: '/about' - } + const map: Record = { + home: "/", + blog: "/blog", + newsletter: "/newsletter", + contact: "/contacto", + about: "/about", + products: "/servicios", + }; return map[slug] || `/about/${slug}`; -} +}; ---
- {pages.map((entry: any) => { - const p = entry?.data ? entry.data : entry; - const title = p?.Title || p?.title || 'Untitled'; - const slug = p?.slug || p?.Slug || p?.id || ''; - const img = p?.Cover?.url || p?.SEO?.socialImage?.url || ''; - const desc = p?.SEO?.metaDescription || (p?.Content && p.Content[0]?.children?.[0]?.text) || ''; + { + pages.map((entry: any) => { + const p = entry?.data ? entry.data : entry; + const title = p?.Title || p?.title || "Untitled"; + const slug = p?.slug || p?.Slug || p?.id || ""; + const img = p?.Cover?.url || p?.SEO?.socialImage?.url || ""; + const desc = + p?.SEO?.metaDescription || + (p?.Content && p.Content[0]?.children?.[0]?.text) || + ""; - return ( -
- -
- {img ? ( - diff --git a/src/components/products/cardProduct.tsx b/src/components/products/cardProduct.tsx deleted file mode 100644 index fee291d..0000000 --- a/src/components/products/cardProduct.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import ProductBadge from './productBadge'; - -interface Props { - thumb_src: string; - thumb_alt: string; - title: string; - description: string; - price: number; - color: string; - colors: string[]; - position: string; -} - -export default function CardProduct({ - thumb_src, - thumb_alt, - title, - description, - price, - color, - colors, - position -}: Props) { - - const classList = "card-body " + "text-" + position; - - return ( - <> - - - ); -}; diff --git a/src/components/products/categoryFilters.tsx b/src/components/products/categoryFilters.tsx index 95cbd35..4a83b81 100644 --- a/src/components/products/categoryFilters.tsx +++ b/src/components/products/categoryFilters.tsx @@ -1,5 +1,5 @@ import data from '../../../public/data.json'; -import CardProduct from '../products/cardProduct'; +import CardProduct from './product.cards'; interface Props { title: string; @@ -13,7 +13,7 @@ export default function ProductOverview({ <>
- {(title.length != 0) && + {(title.length != 0) &&

{title}

}
@@ -157,9 +157,9 @@ export default function ProductOverview({
- {data.products.slice(0, 3).map(product => + {data.products.slice(0, 3).map(product =>
-
- )} + )}
diff --git a/src/components/products/product.cards.tsx b/src/components/products/product.cards.tsx new file mode 100644 index 0000000..839a9f7 --- /dev/null +++ b/src/components/products/product.cards.tsx @@ -0,0 +1,20 @@ +export default function CardProduct({ product, position }: { product: any, position: 'center' }) { + + const classList = 'card-body text-' + position; + + const href = `/servicios/${product.slug || product.id || ''}`; + + return ( + + ); +} diff --git a/src/components/simpleFooter.tsx b/src/components/simpleFooter.tsx index 839e6d9..9692fcf 100644 --- a/src/components/simpleFooter.tsx +++ b/src/components/simpleFooter.tsx @@ -24,7 +24,7 @@ const SimpleFooter: React.FC = ({ store = {} }) => {
{storeName}

{storeDescription}

- {storeSocial?.facebook && ( + {/* {storeSocial?.facebook && ( @@ -38,21 +38,8 @@ const SimpleFooter: React.FC = ({ store = {} }) => { - )} + )} */} {/* Fallback social links if no store social data */} - {!storeSocial?.facebook && !storeSocial?.instagram && !storeSocial?.twitter && ( - <> - - - - - - - - - - - )}
diff --git a/src/pages/astro-ecommerce.draft.astro b/src/pages/astro-ecommerce.draft.astro deleted file mode 100644 index 1b6ce03..0000000 --- a/src/pages/astro-ecommerce.draft.astro +++ /dev/null @@ -1,386 +0,0 @@ ---- -import Layout from '../layouts/Layout.astro'; -import data from '../../public/data.json'; -import '../../assets/scss/astro-ecommerce.scss'; -import Navbar from '../components/navbar'; -import ComplexNavbar from '../components/complexNavbar'; -import ComplexNavbarDark from '../components/complexNavbarDark'; -import Footer from '../components/footer'; -import ComplexFooter from '../components/complexFooter'; -import CardProduct from '../components/products/cardProduct'; -import CardCategory from '../components/products/cardCategory'; -import ProductOverviewGrid from '../components/products/productOverviewGrid'; -import ProductOverviewGallery from '../components/products/productOverviewGallery'; -import ShoppingCart from '../components/cart/shoppingCart'; -import ShoppingCart2 from '../components/cart/shoppingCart2'; -import ProductQuickview from '../components/products/productQuickview'; -import ProductQuickview2 from '../components/products/productQuickview2'; -import ProductFeature from '../components/products/productFeature'; -import ProductFeature2 from '../components/products/productFeature2'; -import CategoryFilters from '../components/products/categoryFilters'; -import TestimonialsFade from '../components/promo/testimonialsFade'; -import PromoSectionLarge from '../components/promo/promoSectionLarge'; -import CheckoutOrderSummary from '../components/checkout/checkoutOrderSummary'; -import CheckoutMultiStep from '../components/checkout/checkoutMultiStep'; -import ReviewSimple from '../components/reviews/reviewSimple'; -import ReviewSummaryChart from '../components/reviews/reviewSummaryChart'; -import OrderSummaries from '../components/order/orderSummaries'; -import OrderHistory from '../components/order/orderHistory'; -import IncentiveLarge from '../components/incentives/incentiveLarge'; -import IncentiveCols from '../components/incentives/incentiveCols'; - -let cartItems = []; -data.shoppingCart.map(id => - data.products.filter(x => x.id == id).map(x => cartItems.push(x)) -) -let cartItems2 = []; -data.shoppingCart2.map(id => - data.products.filter(x => x.id == id).map(x => cartItems2.push(x)) -) - -// filter reviews with ID 01 -let productReviews = data.reviews.filter(x => x.productID == "01"); - -let orderProducts = []; - -data.orders[0].products.forEach(productDetails => { - data.products.forEach(product => { - if (product.id == productDetails.id) { - orderProducts.push(product); - } - }); -}) - -let orderHistoryProducts = new Set(); - -data.orders.forEach((order) => { - order.products.forEach(productDetails => { - data.products.forEach(product => { - if (product.id == productDetails.id) { - orderHistoryProducts.add(product); - } - }); - }) -}) - ---- - - - - -
- -
-

Product Lists

-

Components and blocks for Product Lists

-
- {data.products.map(product => -
- -
- )} -
- -

Product Lists

-

Cards with full details

-
- {data.products.map(product => -
- -
- )} -
- -
-
-

Shop by category

- Browse all categories > -
- {data.categories.slice(0, 4).map(category => -
- -
- )} -
- -
-
-

Shop by category

- Browse all categories > -
-
- -
-
-
- -
-
- -
-
-
- - -
-

Product Overview

-

With image grid

- - -
- -
-

Product Overview

-

Product Overviews with image gallery and expandable details

- - -
- - -
- -
- -
- -
- -
-

Category filters

-

With inline actions and expandable sidebar filters

- -
- -
-

Product Quickviewers

-

With color selector, size selector, and details link

- - - -

Product Quickviewers

-

With large size selector

- -
- -
- -
- -
- -
- -
-

Complex Navbar White

- Browse all categories > -

- -
- {data.products.map(product => -
- -
- )} -
- -

Complex Navbar Dark

- Browse all categories > -

- -
- {data.products.map(product => -
- -
- )} -
-
- -
-

Simple Footer

-
- -

Complex Footer

- -
- -
-

Promo Sections

-

Full-width with background image and large content

- -
- -
-

Promo Sections

-

With fading background image and testimonials

- -
- -
-

Checkout Forms

-

Split with order summary

- -
- -
-

Checkout Forms

-

SWith order summary sidebar

- -
- -
-

Product reviews

-

Simple with avatars

- -
- -
-

Product reviews

-

With summary chart

- -
- -
-

Order Summaries

-

With order summary sidebar

- -
- -
- -
- -
- -
- -
-

Features

-

3-column with illustrations and header

- -
- -
-
-
-
diff --git a/src/pages/index.astro b/src/pages/index.astro index d921b5f..31dc11e 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,9 +1,8 @@ --- import Layout from "../layouts/Layout.astro"; -import data from "../../public/data.json"; import SimpleNavbar from "../components/simpleNavbar"; import SimpleFooter from "../components/simpleFooter"; -import CardProduct from "../components/products/cardProduct"; +import CardProduct from "../components/products/product.cards"; import PageCards from "../components/markket/pages.cards.astro"; import { getCollection } from "astro:content"; @@ -15,9 +14,9 @@ const storeDescription = store.Description || "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos. Ejemplos, tutoriales y documentación en español."; const storeLogo = store.Logo?.url || ""; -const storeCover = store.Cover?.url || ""; const storeSEO = store.SEO || {}; -const pages = (await getCollection("pages"))?.splice(0, 2); +const pages = (await getCollection("pages"))?.splice(0, 3); +const products = (await getCollection("products"))?.splice(0, 2); ---
@@ -49,7 +48,7 @@ const pages = (await getCollection("pages"))?.splice(0, 2); src={storeLogo} alt={`${storeName} Logo`} class="mb-4" - style="height: 60px; object-fit: contain; filter: brightness(0) invert(1);" + style="height: 120px; object-fit: contain; border: 4px solid white; border-radius: 12px; box-shadow: 10px 5px 5px #195fc6" /> ) } @@ -76,33 +75,21 @@ const pages = (await getCollection("pages"))?.splice(0, 2);
-

Productos Destacados

-

- Descubre nuestros artículos más populares -

+

Servicios Destacados

{ - data.products.slice(0, 4).map((product) => ( -
- + products.map((product) => ( +
+
)) }
diff --git a/src/pages/product.astro b/src/pages/product.astro index ca5bedc..354eeba 100644 --- a/src/pages/product.astro +++ b/src/pages/product.astro @@ -1,22 +1,22 @@ --- -import Layout from '../layouts/Layout.astro'; -import data from '../../public/data.json'; -import '../../assets/scss/astro-ecommerce.scss'; -import Navbar from '../components/navbar'; -import CardProduct from '../components/products/cardProduct'; -import ProductOverviewGrid from '../components/products/productOverviewGrid'; -import StoreDoubleColumn from '../components/store/storeDoubleColumn'; -import ReviewSummaryChart from '../components/reviews/reviewSummaryChart'; +import Layout from "../layouts/Layout.astro"; +import data from "../../public/data.json"; +import "../../assets/scss/astro-ecommerce.scss"; +import Navbar from "../components/navbar"; +import CardProduct from "../components/products/product.cards"; +import ProductOverviewGrid from "../components/products/productOverviewGrid"; +import StoreDoubleColumn from "../components/store/storeDoubleColumn"; +import ReviewSummaryChart from "../components/reviews/reviewSummaryChart"; // filter reviews with ID 01 -let productReviews = data.reviews.filter(x => x.productID == "01"); +let productReviews = data.reviews.filter((x) => x.productID == "01"); --- -
+
- x.productID == "01"); rating={data.products[0].rating} reviews={data.products[0].reviews} sizes={data.products[0].sizes} - /> + />
- +
Customers also purchased
- {data.products.map(product => -
- -
- )} + { + data.products.map((product) => ( +
+ +
+ )) + }

- - \ No newline at end of file + diff --git a/src/pages/servicios/[slug].astro b/src/pages/servicios/[slug].astro index bb1b638..bf0d0ab 100644 --- a/src/pages/servicios/[slug].astro +++ b/src/pages/servicios/[slug].astro @@ -1,4 +1,60 @@ --- +import Layout from "../../layouts/BasicLayout.astro"; +import { getCollection } from "astro:content"; +import { marked } from "marked"; + +export async function getStaticPaths() { + const products = await getCollection("products"); + return products.map((p) => ({ params: { slug: p.data?.slug || p.id } })); +} + +const products = await getCollection("products"); +const { slug } = Astro.params; + +const entry = products.find((p) => (p.data?.slug || p.id) == slug); +if (!entry) throw new Error(`Producto no encontrado: ${slug}`); +const product = entry?.data; +if (!product) throw new Error(`Producto no encontrado o mal formado: ${slug}`); --- -
Servicios
+ +
+
+
+
+
+ {product.Name} +
+
+

{product.Name}

+

+ {product.SEO?.metaDescription} +

+

+ {product.PRICES?.[0]?.Price} +

+
+ + +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
diff --git a/src/pages/servicios/index.astro b/src/pages/servicios/index.astro index b0a07e0..29965f6 100644 --- a/src/pages/servicios/index.astro +++ b/src/pages/servicios/index.astro @@ -1,42 +1,34 @@ --- -import Layout from "../layouts/Layout.astro"; -import SimpleNavbar from "../components/simpleNavbar"; -import SimpleFooter from "../components/simpleFooter"; -import CardProduct from "../components/products/cardProduct"; -import data from "../../public/data.json"; - +import Layout from "../../layouts/BasicLayout.astro"; +import CardProduct from "../../components/products/product.cards"; import { getCollection } from "astro:content"; const storeData = await getCollection("store"); +const products = await getCollection("products"); +const pages = await getCollection("pages"); + +const page = pages.find((p) => p.data?.slug === "products")?.data; + const store = storeData[0]?.data || {}; -const storeName = store.title || "Markkët Express"; -const storeDescription = - store.Description || - "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos."; -const storeLogo = store.Logo?.url || ""; const storeSEO = store.SEO || {}; --- - - -
-
-

Nuestros Productos

+

{page?.Title || "Servicios"}

- Descubre nuestra amplia gama de productos de alta calidad + {page?.SEO?.metaDEscription}

@@ -44,87 +36,40 @@ const storeSEO = store.SEO || {};
- -
-
-
-
Mostrando {data.products.length} productos
-
-
-
- - - - -
-
-
-
- -
{ - data.products.map((product) => ( -
- + products.map((product: any) => ( + )) }
- -
-
-

Categorías

-

Explora nuestros productos por categoría

-
-
- { - data.categories.map((category) => ( -
-
- {category.title} -
-
{category.title}
-

{category.collection}

- -
-
-
- )) - } -
-
- -
-

¿Quieres ser el primero en saber sobre nuevos productos?

+

+ ¿Quieres ser el primero en saber sobre nuevos productos? +

- Suscríbete a nuestro boletín y mantente al día con las últimas novedades + Suscríbete a nuestro boletín y mantente al día con las últimas + novedades

- +
- - -
- - \ No newline at end of file diff --git a/src/pages/shopping-cart.astro b/src/pages/shopping-cart.astro index 425868b..145592d 100644 --- a/src/pages/shopping-cart.astro +++ b/src/pages/shopping-cart.astro @@ -1,44 +1,45 @@ --- -import Layout from '../layouts/Layout.astro'; -import data from '../../public/data.json'; -import '../../assets/scss/astro-ecommerce.scss'; -import Navbar from '../components/navbar'; -import UpperNavbar from '../components/store/upperNavbar'; -import CardProduct from '../components/products/cardProduct'; -import ShoppingCart from '../components/cart/shoppingCart'; -import StoreDoubleColumn from '../components/store/storeDoubleColumn'; +import Layout from "../layouts/Layout.astro"; +import data from "../../public/data.json"; +import "../../assets/scss/astro-ecommerce.scss"; +import Navbar from "../components/navbar"; +import UpperNavbar from "../components/store/upperNavbar"; +import CardProduct from "../components/products/product.cards"; +import ShoppingCart from "../components/cart/shoppingCart"; +import StoreDoubleColumn from "../components/store/storeDoubleColumn"; let cartItems = []; -data.shoppingCart.map(id => - data.products.filter(x => x.id == id).map(x => cartItems.push(x)) -) +data.shoppingCart.map((id) => + data.products.filter((x) => x.id == id).map((x) => cartItems.push(x)) +); --- -
+
- - + +
You may also like...
- {data.products.map(product => -
- -
- )} + { + data.products.map((product) => ( +
+ +
+ )) + }

- - \ No newline at end of file + From ad7877a0fd46b60516f174599880e4343a02cf32 Mon Sep 17 00:00:00 2001 From: Daveed Date: Tue, 7 Oct 2025 15:39:17 -0400 Subject: [PATCH 7/7] draft for /blog --- src/pages/blog.astro | 245 ---------------------------------- src/pages/blog/[slug].astro | 100 ++++++++++++++ src/pages/blog/index.astro | 182 +++++++++++++++++++++++++ src/pages/product.astro | 57 -------- src/pages/shopping-cart.astro | 45 ------- 5 files changed, 282 insertions(+), 347 deletions(-) delete mode 100644 src/pages/blog.astro create mode 100644 src/pages/blog/[slug].astro create mode 100644 src/pages/blog/index.astro delete mode 100644 src/pages/product.astro delete mode 100644 src/pages/shopping-cart.astro diff --git a/src/pages/blog.astro b/src/pages/blog.astro deleted file mode 100644 index 4389148..0000000 --- a/src/pages/blog.astro +++ /dev/null @@ -1,245 +0,0 @@ ---- -import Layout from "../layouts/Layout.astro"; -import SimpleNavbar from "../components/simpleNavbar"; -import SimpleFooter from "../components/simpleFooter"; - -import { getCollection } from "astro:content"; - -const storeData = await getCollection("store"); -const store = storeData[0]?.data || {}; -const storeName = store.title || "Markkët Express"; -const storeDescription = - store.Description || - "Plantilla y tienda compatible con Markkët para prestar servicios y vender productos."; -const storeLogo = store.Logo?.url || ""; -const storeSEO = store.SEO || {}; - -// Sample blog posts - later this would come from your CMS -const blogPosts = [ - { - id: 1, - title: "Cómo elegir el producto perfecto para ti", - excerpt: "Descubre los factores clave que debes considerar al elegir productos que se adapten a tus necesidades y estilo de vida.", - image: "https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80", - author: "Equipo Markkët", - date: "2024-10-01", - category: "Guías", - readTime: "5 min" - }, - { - id: 2, - title: "Tendencias 2024: Lo que está de moda", - excerpt: "Explora las últimas tendencias y descubre qué estilos dominarán este año en el mundo de la moda y los productos.", - image: "https://images.unsplash.com/photo-1441986300917-64674bd600d8?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80", - author: "María González", - date: "2024-09-28", - category: "Tendencias", - readTime: "7 min" - }, - { - id: 3, - title: "Cuidado y mantenimiento de tus productos", - excerpt: "Aprende las mejores prácticas para mantener tus productos en perfecto estado y prolongar su vida útil.", - image: "https://images.unsplash.com/photo-1558618047-3c8c76ca7d13?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80", - author: "Carlos Rodríguez", - date: "2024-09-25", - category: "Tips", - readTime: "6 min" - } -]; ---- - - - - - -
- -
-
-
-
-

Blog de {storeName}

-

- Descubre consejos, tendencias y noticias del mundo de nuestros productos -

-
-
-
-
- -
- -
-
-
- {blogPosts[0].title} -
-
-
{blogPosts[0].category}
-

{blogPosts[0].title}

-

{blogPosts[0].excerpt}

-
- - {blogPosts[0].author} - - {blogPosts[0].date} - - {blogPosts[0].readTime} -
- - Leer Artículo - - -
-
-
- - -
-
-
-

Últimos Artículos

-
-
-
- - - - -
-
-
- -
- { - blogPosts.slice(1).map((post) => ( -
-
- {post.title} -
-
- {post.category} -
-
{post.title}
-

{post.excerpt}

-
- - {post.author} - - {post.readTime} -
- - Leer Más - -
-
-
- )) - } -
-
- - -
-
-

¿No te quieres perder nada?

-

- Suscríbete a nuestro boletín y recibe los últimos artículos directamente en tu inbox -

-
-
-
- - -
-
-
-
-
- - -
-
-

Explora por Categorías

-
-
-
-
- -
Guías
-

Consejos prácticos y tutoriales

- Ver Guías -
-
-
-
- -
Tendencias
-

Lo último en moda y estilo

- Ver Tendencias -
-
-
-
- -
Tips
-

Consejos útiles y trucos

- Ver Tips -
-
-
-
- -
Noticias
-

Últimas novedades

- Ver Noticias -
-
-
-
-
-
- - - -
- - \ No newline at end of file diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro new file mode 100644 index 0000000..2595fee --- /dev/null +++ b/src/pages/blog/[slug].astro @@ -0,0 +1,100 @@ +--- +import Layout from "../../layouts/BasicLayout.astro"; +import BlocksContent from "../../components/blocks.content.astro"; +import { getCollection } from "astro:content"; + +export async function getStaticPaths() { + const posts = await getCollection("posts"); + + return posts.map((p) => ({ params: { slug: p.data?.slug || p.id } })); +} + +const pages = await getCollection("pages"); + +const { slug } = Astro.params; +const posts = await getCollection("posts"); +const current = posts.find((p) => p.data?.slug === slug || p.id === slug)?.data; +if (!current) throw new Error(`Page not found: ${slug}`); + +const relatedPosts = pages.filter( + (p) => ![slug,].includes(p.data?.slug) +).splice(0,3) +--- + + +
+
+
+
+
+

{current?.Title }

+

{current.SEO.metaDescription}

+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+

Articulos relacionados

+
+
+
+
+ { + relatedPosts.slice(1).map((post) => ( +
+
+ {post?.data?.Title} +
+
+ {'x'} +
+
{post.data.Title}
+

+ {post.data.SEO?.metaDescription} +

+
+ + {'x'} + + {'x'} +
+ + Leer Más + +
+
+
+ )) + } +
+
+
+
+
diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro new file mode 100644 index 0000000..6cce8f2 --- /dev/null +++ b/src/pages/blog/index.astro @@ -0,0 +1,182 @@ +--- +import Layout from "../../layouts/BasicLayout.astro"; + +import { getCollection } from "astro:content"; + +const storeData = await getCollection("store"); +const store = storeData[0]?.data || {}; +const storeName = store.title || "Markkët Express"; +const storeSEO = store.SEO || {}; + +const articles = (await getCollection("posts")) || []; +const page = ((await getCollection("pages")) || [])?.find( + (p) => p?.data?.slug == "blog" +)?.data; +--- + + +
+
+
+
+
+

{page?.Title || "Blog"}

+

+ {page?.SEO?.metaDescription} +

+
+
+
+
+ +
+
+
+
+ {articles?.[0]?.data?.Title} +
+
+

{articles?.[0]?.data.Title}

+

+ {articles?.[0]?.data.SEO?.metaDescription} +

+
+ + {articles?.[0]?.data?.SEO?.metaAuthor} + + {articles?.[0]?.data?.SEO?.createdAt} + +
+ + Leer Artículo + + +
+
+
+
+
+
+

Últimos Artículos

+
+ +
+ +
+ { + articles.slice(1).map((post) => ( +
+
+ {post?.data?.Title} +
+
+ {"x"} +
+
{post.data.Title}
+

+ {post.data.SEO?.metaDescription} +

+
+ + {"x"} + + {"x"} +
+ + Leer Más + +
+
+
+ )) + } +
+
+ + +
+
+

¿No te quieres perder nada?

+

+ Suscríbete a nuestro boletín y recibe los últimos artículos + directamente en tu inbox +

+
+
+
+ + +
+
+
+
+
+ + +
+
+

Explora por Categorías

+
+
+
+
+ +
Guías
+

Consejos prácticos

+
+
+
+
+ +
Tips
+

Simples trucos

+
+
+
+
+ +
Noticias
+

Últimas novedades

+
+
+
+
+
+
+
diff --git a/src/pages/product.astro b/src/pages/product.astro deleted file mode 100644 index 354eeba..0000000 --- a/src/pages/product.astro +++ /dev/null @@ -1,57 +0,0 @@ ---- -import Layout from "../layouts/Layout.astro"; -import data from "../../public/data.json"; -import "../../assets/scss/astro-ecommerce.scss"; -import Navbar from "../components/navbar"; -import CardProduct from "../components/products/product.cards"; -import ProductOverviewGrid from "../components/products/productOverviewGrid"; -import StoreDoubleColumn from "../components/store/storeDoubleColumn"; -import ReviewSummaryChart from "../components/reviews/reviewSummaryChart"; - -// filter reviews with ID 01 -let productReviews = data.reviews.filter((x) => x.productID == "01"); ---- - - -
- -
- - -
- -
- -
-
Customers also purchased
- { - data.products.map((product) => ( -
- -
- )) - } -
-
- -
-
-
diff --git a/src/pages/shopping-cart.astro b/src/pages/shopping-cart.astro deleted file mode 100644 index 145592d..0000000 --- a/src/pages/shopping-cart.astro +++ /dev/null @@ -1,45 +0,0 @@ ---- -import Layout from "../layouts/Layout.astro"; -import data from "../../public/data.json"; -import "../../assets/scss/astro-ecommerce.scss"; -import Navbar from "../components/navbar"; -import UpperNavbar from "../components/store/upperNavbar"; -import CardProduct from "../components/products/product.cards"; -import ShoppingCart from "../components/cart/shoppingCart"; -import StoreDoubleColumn from "../components/store/storeDoubleColumn"; - -let cartItems = []; -data.shoppingCart.map((id) => - data.products.filter((x) => x.id == id).map((x) => cartItems.push(x)) -); ---- - - -
- - - - -
-
-
You may also like...
- { - data.products.map((product) => ( -
- -
- )) - } -
-
- -
-
-