Skip to content

Phase 4 - Skeleton Layout & Routing

  • Tier: Foundation (Phase 4 of 12)
  • Scope: Essential, with one Recommended step (scope labels follow ADR-033)
  • Effort: Moderate, depends on project complexity
  • Dependencies: Phase 0-3 completed
  • Deliverables: Base layout, routing structure, navigation, metadata system
  • Code examples: Phase 4 - Code Examples
  • Design system configured
  • Content architecture defined
  • Tooling and CI functional
  • Initial performance baseline planned
StepTaskScopeNotes
4.01Create base layoutEssentialHTML structure, metadata
4.02Build header componentEssentialLogo, nav, theme toggle
4.03Build footer componentEssentialLinks, copyright
4.04Design mobile navigationEssentialResponsive pattern
4.05Create minimal page routesEssentialindex.astro & 404.astro only. See guide.
4.06Set up metadata systemEssentialSEO, OpenGraph
4.07Configure font loadingEssentialPreload, swap
4.08Add security headersEssentialCSP, HSTS
4.09Set up skip linksEssentialAccessibility
4.10Create error pagesEssential404, 500
4.11Review analytics optionsRecommendedOptional. See dedicated guide.
4.12Baseline performanceEssentialInitial metrics

This template does not include analytics out-of-the-box to respect user privacy. Adding analytics is an optional step that you can take based on your project’s needs. We have created a detailed guide with copy-paste recipes for popular, privacy-focused providers.

This approach keeps the template clean while empowering you to make the right choice for your site.

  1. Missing Font Attributes: Forgetting crossorigin on preload

    • Solution: Always include all required attributes
  2. Blocking Resources: Scripts/styles blocking render

    • Solution: Use defer/async, critical CSS inline
  3. Poor Mobile UX: Desktop-first navigation

    • Solution: Design mobile-first, test on devices
  4. Missing Meta Tags: Incomplete SEO/social setup

    • Solution: Use layout component for consistency
  • Base layout component complete
  • Header with navigation functional
  • Footer with links and social
  • Mobile navigation working smoothly
  • All main routes created
  • Metadata system implemented
  • Fonts loading optimally
  • Security headers configured
  • Skip links for accessibility
  • Error pages created
  • Analytics ready (privacy-first)
  • Performance baseline recorded

If skeleton needs major changes:

  1. Layout Issues:

    • Keep old layout as BaseLayoutV1
    • Migrate pages gradually
    • Test each migration
  2. Route Changes:

    • Set up redirects in config
    • Update sitemap
    • Check internal links
  3. Performance Regression:

    • Compare with baseline
    • Check resource loading
    • Review recent changes
  • src/layouts/BaseLayout.astro - Main layout
  • src/components/molecules/Head.astro - Metadata, Open Graph, and font loading
  • src/components/structural/* - Header/Footer
  • src/components/a11y/SkipLink.astro - Skip link
  • public/_headers - Security headers
  • performance-baseline.json - Performance baseline (written to the repo root by pnpm run perf:baseline against an already-running preview; the starter does not commit one)
  • “Create Astro layout with SEO metadata”
  • “Build accessible mobile navigation”
  • “Set up security headers for Astro”
  • “Configure font preloading strategy”
  • Site structure and pages
  • Brand/logo assets
  • Navigation hierarchy
  • Performance targets