Skip to main content

Astro-site:
Structure

image for Structure

Folder structure

src/
  pages/
  layouts/
  components/
  assets/gallery/
  styles/

Pages

Pages are .astro files inside src/pages/.

Example homepage:

---
import BaseLayout from '../layouts/BaseLayout.astro';
import Gallery from '../components/Gallery.astro';
---

<BaseLayout title="george reay">
  <Gallery />
</BaseLayout>

Layout

The layout contains:

  • <head> tags
  • Header
  • <main> area
  • Footer with auto-updating year

Assets

Place .webp files into:

src/assets/gallery/

Astro automatically imports them and generates readable titles from filenames.