Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DavidEspinozaRomero/Proyecto-de-vivienda-social-renacer/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Proyecto Renacer is built with Astro, which generates a static site that can be deployed to any static hosting service. This guide covers the build process, deployment options, and production optimizations.Build Process
Development Commands
The project uses npm scripts for development and building:Available Scripts
package.json
npm run dev
Starts the development server at
localhost:4321 with hot module reloadingnpm run build
Builds the production site to
./dist/ directorynpm run preview
Previews the production build locally before deploying
npm run astro
Access Astro CLI commands for advanced operations
Building for Production
Step 1: Install Dependencies
Ensure all dependencies are installed:package.json
Step 2: Run the Build
Generate the static site:The build process will:
- Compile all
.astrofiles to static HTML - Process and optimize CSS with Tailwind
- Bundle JavaScript and assets
- Generate a static site in the
./dist/directory
Step 3: Test the Build Locally
Preview the production build before deploying:dist/ directory, allowing you to test the production build.
Static Site Output
Output Structure
After runningnpm run build, the dist/ directory will contain:
Astro generates clean URLs by creating a directory for each page with an
index.html file inside. This allows URLs like /proyecto instead of /proyecto.html.Build Output
The build command will show output similar to:Deployment Options
Option 1: Netlify (Current Setup)
The project is currently deployed on Netlify at:Netlify Configuration
Create anetlify.toml in the root directory:
netlify.toml
Deploy Steps
Configure Build Settings
- Build command:
npm run build - Publish directory:
dist - Node version: 18 or higher
Option 2: Vercel
Vercel offers excellent Astro support with zero configuration: Or connect your repository through the Vercel dashboard. Vercel will auto-detect:- Framework: Astro
- Build command:
npm run build - Output directory:
dist
Option 3: GitHub Pages
Deploy to GitHub Pages using GitHub Actions:.github/workflows/deploy.yml
astro.config.mjs for GitHub Pages:
astro.config.mjs
Option 4: Cloudflare Pages
Deploy to Cloudflare Pages:Option 5: Traditional Web Hosting
For traditional hosting (cPanel, FTP):Environment Configuration
Environment Variables
Astro supports environment variables through.env files:
.env
Using Environment Variables
Example Usage
Platform-Specific Variables
For production deployments, set environment variables in your hosting platform:- Netlify
- Vercel
- Cloudflare
Site Configuration → Environment Variables
Production Optimizations
Astro Built-in Optimizations
Astro automatically provides:Static HTML
Pages are pre-rendered to static HTML for fast load times
CSS Optimization
Tailwind CSS is purged and minified automatically
Asset Optimization
Images and assets are optimized during build
Zero JS by Default
Only ships JavaScript when needed
Custom Optimizations
1. Image Optimization
Use Astro’s built-in Image component for optimized images:2. Font Loading Strategy
The project already uses optimized font loading:src/layouts/Layout.astro
display=swap ensures text remains visible during font load.
3. Analytics
The project includes Ahrefs analytics:src/layouts/Layout.astro
Performance Checklist
Minimize External Resources
Minimize External Resources
- Use system fonts when possible
- Self-host critical fonts
- Lazy load non-critical scripts
Optimize Images
Optimize Images
- Use WebP format
- Provide appropriate sizes for different viewports
- Use lazy loading for below-fold images
CSS Optimization
CSS Optimization
- Tailwind automatically purges unused CSS
- Avoid large custom CSS files
- Use CSS variables for theme values
Reduce HTTP Requests
Reduce HTTP Requests
- Combine similar resources
- Use CSS instead of images when possible
- Leverage browser caching
Continuous Deployment
Git-Based Workflow
For automated deployments:Branch Previews
Most platforms support preview deployments for pull requests:- Netlify: Automatic deploy previews for PRs
- Vercel: Preview deployments for every push
- Cloudflare Pages: Branch previews available
Troubleshooting
Common Build Issues
Build Fails - Module Not Found
Build Fails - Module Not Found
Solution: Clear node_modules and reinstall
Styles Not Applied in Production
Styles Not Applied in Production
Solution: Ensure Tailwind is properly configured and imported
src/styles/global.css
404 on Page Refresh
404 on Page Refresh
Solution: Configure your hosting to redirect all routes to index.html (SPA mode) or ensure proper static file generation
Assets Not Loading
Assets Not Loading
Solution: Use relative paths or configure base URL in
astro.config.mjsMonitoring and Analytics
Current Analytics Setup
The site uses Ahrefs analytics for tracking:Adding Google Analytics
To add Google Analytics:src/layouts/Layout.astro
Domain Configuration
Current Domain
The site is deployed at:Setting Up a Custom Domain
Next Steps
Content Management
Learn how to update content
Styling Guide
Customize the design
Astro Deployment
Official Astro deployment guide
Performance Tips
Optimize your site further