Layout Structure
Arte y Web Creaciones uses a consistent layout structure across all pages, defined insrc/layouts/Layout.astro. This layout provides SEO optimization, meta tags, global styles, and common components.
Main Layout Component
Location:src/layouts/Layout.astro
Key Features
- SEO-optimized meta tags
- Open Graph and Twitter Card support
- Google Fonts integration (Inter & Outfit)
- Google Tag Manager integration
- Schema.org structured data
- Global CSS imports
- Navbar and Footer components
- Cookie consent component
Layout Structure Overview
Props and Defaults
The layout accepts props to customize SEO and metadata:Available Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | ”Diseño Web Profesional desde 190€ | Arte y Web Creaciones” | Page title |
description | string | ”Diseño web profesional y tiendas online desde 190€…” | Meta description |
keywords | string | ”diseño web profesional, páginas web, tiendas online…” | SEO keywords |
image | string | ”https://arteywebcreaciones.com/img/hero-imagen.webp” | OG/Twitter image |
websiteName | string | ”Arte y Web Creaciones” | Site name for OG |
robots | string | ”index, follow, max-image-preview:large…” | Robot directives |
Example Usage
Canonical URL Generation
The layout automatically generates canonical URLs based on the current path:Meta Tags
Basic SEO Tags
Fromsrc/layouts/Layout.astro:40-66:
Open Graph Tags
Fromsrc/layouts/Layout.astro:68-76:
Twitter Card Tags
Fromsrc/layouts/Layout.astro:78-83:
Google Fonts
The layout imports two Google Font families:- Inter: Used for body text (weights: 300, 400, 500, 600)
- Outfit: Used for headings (weights: 400, 500, 600, 700, 800)
Global CSS Structure
Imported in order:Global CSS Location
Global Components
Navbar
Location:src/components/NavBar.astro
- Site navigation
- Logo/branding
- Mobile menu
- Navigation links from
menu.json
Footer
Location:src/components/Footer.astro
- Site links
- Contact information
- Social media links
- Legal links (Privacy, Terms, Cookies)
Cookies Component
Location:src/components/Legales/Cookies.astro
- Cookie consent banner
- GDPR compliance
- Cookie preferences management
Schema.org Structured Data
The layout includes JSON-LD structured data for SEO (from line 97+):Google Tag Manager
Integrated via script:HTML Attributes
lang="es": Sets Spanish as the page languagedata-bs-theme="light": Bootstrap theme mode (if using Bootstrap)
Viewport Meta Tag
Favicon
public/favicon.png.
Sitemap Link
Creating a New Page with Layout
- Create a new
.astrofile insrc/pages/ - Import and use the Layout component:
- The Navbar, Footer, and Cookies components will automatically be included
Best Practices
- Always use the Layout: Wrap all pages with
<Layout>for consistency - Customize meta tags: Pass custom
titleanddescriptionfor each page - Use semantic HTML: Wrap page content in
<main>tags - OG images: Provide custom
imageprop for social sharing - Keep titles unique: Each page should have a descriptive, unique title
- Maintain canonical URLs: Let the layout handle canonical URL generation
Accessibility Features
- Semantic HTML structure
- Proper language attribute (
lang="es") - Meta viewport for responsive design
- Accessible navigation components
Performance Optimizations
- Font preconnect for faster font loading
- Deferred GTM script loading
- CSS in optimal load order
- Proper caching headers (via Astro config)