Overview
Proyecto Renacer uses Astro’s file-based routing system. Each.astro file in /src/pages/ automatically becomes a route based on its filename.
Available Pages
index.astro
Home page at
/ - Main landing page with hero sectioncomo-ser-socio.astro
How to become a member at
/como-ser-socioproyecto.astro
Project information at
/proyectorequisitos.astro
Requirements page at
/requisitoscontacto.astro
Contact page at
/contactonoticias.astro
News page at
/noticiaslanding.astro
Alternative landing page at
/landingdesign-system.astro
Design system showcase at
/design-systemRouting System
Astro’s file-based routing automatically creates routes:| File Path | URL Route |
|---|---|
/src/pages/index.astro | / |
/src/pages/proyecto.astro | /proyecto |
/src/pages/como-ser-socio.astro | /como-ser-socio |
/src/pages/requisitos.astro | /requisitos |
/src/pages/contacto.astro | /contacto |
/src/pages/noticias.astro | /noticias |
Page Structure
All pages follow a consistent structure:Basic Page Anatomy
Frontmatter (Script Section)
The code between--- markers runs at build time:
- Imports: Load components, layouts, and utilities
- Data fetching: Import data from
/src/data/ - Props: Define page-specific variables
- Server-side logic: Runs only during build, not in browser
Template Section
The HTML-like markup below the frontmatter defines the page structure.Example: Home Page (index.astro)
Let’s examine the home page structure:src/pages/index.astro
- Uses shared
Layoutfor consistent HTML structure - Imports data from
state.tsfor dynamic content - Multiple sections with semantic HTML
- Responsive design with Tailwind classes
- Component composition with
Button,CardMd, etc.
Example: Como Ser Socio Page
This page demonstrates progress tracking:src/pages/como-ser-socio.astro
- Dynamic progress calculation using
socios.porcentaje() - Inline styles for dynamic width
- Grid layouts for responsive step-by-step display
- Hero section with background image
Data Flow
Pages can import and use shared data:SEO and Meta Tags
Every page defines SEO-friendly metadata:Layout component handles:
<title>tag- Meta descriptions
- Open Graph tags
- Structured data
Styling Approach
Pages use Tailwind CSS utility classes:px-4 md:px-20 lg:px-40- Responsive horizontal paddingpy-12 md:py-20- Responsive vertical paddingflex-col lg:flex-row- Stack on mobile, row on desktopdark:prefix - Dark mode variants
Navigation Between Pages
Pages link to each other using standard anchor tags:Button component:
Component Composition
Pages compose smaller components:Best Practices
Keep frontmatter clean
Keep frontmatter clean
Only import what you need. Unused imports slow down builds.
Use semantic HTML
Use semantic HTML
Structure content with proper
<section>, <article>, <header> tags for accessibility.Define SEO metadata
Define SEO metadata
Every page should have unique
title and description values.Responsive by default
Responsive by default
Always include mobile-first responsive classes (sm:, md:, lg:).
Component reusability
Component reusability
If content repeats, extract it to a component.
Next Steps
Components
Learn about reusable UI components used in pages
Layouts
Understand how layouts wrap and structure pages