Proyecto Renacer uses Astro’s file-based routing system for pages and a centralized data management approach through TypeScript modules. This guide covers how to update existing content, manage application state, add new pages, and handle SEO.
Import and use the state data in any page or component:
src/pages/index.astro
---import { socios } from "../data/state";---<p class="text-sm font-medium text-slate-500"> Más de {socios.actual} familias ya son parte de este sueño.</p>
When to Update: The state.ts file should be updated whenever the number of partners (socios) changes or other dynamic project metrics need to be reflected across the site.
---// 1. Importsimport Layout from "../layouts/Layout.astro";import Header from "../components/Header.astro";import Button from "../components/Button.astro";import Footer from "../components/Footer.astro";import { socios } from "../data/state";// 2. Page metadataconst title = "Page Title | Proyecto Renacer";const description = "Page description for SEO";---<!-- 3. Template --><Layout title={title} description={description}> <Header /> <!-- Your content here --> <Footer /></Layout>
The project includes several reusable components in src/components/:
// Layout ComponentsLayout.astro // Main layout wrapperHeader.astro // Site header with navigationFooter.astro // Site footerNavigation.astro // Navigation menuNavItem.astro // Individual nav items// Content ComponentsCardLg.astro // Large card componentCardMd.astro // Medium card componentCardSm.astro // Small card componentButton.astro // Button with variantsButtonTransparent.astro // Transparent button variant// SEO ComponentsHead.astro // Meta tags and SEOOpenGraph.astro // Open Graph tags for social sharing// Utility ComponentsWelcome.astro // Welcome bannerInprogress.astro // In-progress indicator
Each page should define its own title and description:
src/pages/index.astro
---const title = "Proyecto de Vivienda Social Renacer | Terrenos en Ambato";const description = "Proyecto de vivienda social Renacer en Ambato. Una oportunidad para personas que no tienen vivienda propia y desean obtener su primer terreno. Conoce requisitos y cómo ser socio.";---<Layout title={title} description={description}> <!-- Page content --></Layout>
Open Graph tags for social media sharing are in src/components/OpenGraph.astro:
src/components/OpenGraph.astro
---let { OGTitle = "Proyecto de Vivienda Social Renacer | Terrenos en Ambato", OGDescription = "¿No tienes casa propia en Ambato? Conoce el proyecto de vivienda social Renacer y descubre cómo obtener tu primer terreno.", OGImage = "https://proyectoviviendarenacer.netlify.app/img/mockImg.webp",} = Astro.props;---<!-- Facebook Meta Tags --><meta property="og:title" content={OGTitle}><meta property="og:description" content={OGDescription}><meta property="og:type" content="website"><meta property="og:url" content="https://proyectoviviendarenacer.netlify.app"><meta property="og:image" content={OGImage}><meta property="og:locale" content="es_EC"><meta property="og:site_name" content="Proyecto de Vivienda Social Renacer"><!-- Twitter Card --><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content={OGTitle}><meta name="twitter:description" content={OGDescription}><meta name="twitter:image" content={OGImage}>
You can customize Open Graph tags for specific pages:
Example
---const title = "Requisitos | Proyecto Renacer";const description = "Conoce los requisitos necesarios...";const OGTitle = "Requisitos para ser socio del Proyecto Renacer";const OGDescription = "Descubre si calificas para obtener tu terreno en Ambato";const OGImage = "https://proyectoviviendarenacer.netlify.app/img/requisitos-social.jpg";---<Layout title={title} description={description} OGTitle={OGTitle} OGDescription={OGDescription} OGImage={OGImage}>