1
Astro 7.4 is here (astro.build)
submitted 3 weeks ago by to c/astro@programming.dev
2
Astro 7.3 is here (astro.build)
submitted 2 months ago by to c/astro@programming.dev
3
submitted 2 months ago by to c/astro@programming.dev
4
5
Astro 7.2 is here! (astro.build)
submitted 3 months ago by to c/astro@programming.dev
6
7
Astro 7.1 (astro.build)
submitted 3 months ago by to c/astro@programming.dev
8
Astro 7.0 (astro.build)
submitted 4 months ago by to c/astro@programming.dev
9
10
Astro 6.4 released (astro.build)
submitted 5 months ago by to c/astro@programming.dev
11
Starlight 0.39 (astro.build)
submitted 6 months ago by to c/astro@programming.dev
12
Astro 6.2 released (astro.build)
submitted 6 months ago by to c/astro@programming.dev
 
 

Astro 6.2 introduces an experimental custom logger with JSON output, an SVG optimizer API, a new font file URL helper, and more.

13
14
15
16
Astro 6.1 is here (astro.build)
submitted 7 months ago by to c/astro@programming.dev
17
Astro 6.0 is here (astro.build)
submitted 8 months ago by to c/astro@programming.dev
18
19
 
 

So i try to make a Gallery with Astro and i hope someone can help me to grasp a few things.

I have a folder called "assets" in "src" in which all the images reside.

I also have a .astro file in "pages".
In this file i try to get the images with:

const images = import.meta.glob('/src/assets/*.{jpeg,jpg,png,gif}')  
const resolvedImages = Object.entries(images)  

in the body of the .astro i try to map "resolvedImages"

{resolvedImages.map((image) => (  
	<Image src={image[0]} alt="blabla" />  
))}  

Which kinda works but feels wrong. That i have to write "image[0]" instead of "image.src" can't be the solution.

There seems to be something called "ImageMetadata " , which has all the things i would like to have access to (filepath, width, etc.). But i don`t understand how to use it.

When i try

const images = import.meta.glob<ImageMetadata>('/src/assets/*.{jpeg,jpg,png,gif}')  

I still can´t access the values. What am i not understanding?

Also, is that even the right approach? There is also the option to define a collection and get that but the docs say those are just for markdown?

Thanks in advance.

20
21
Astro 5.17 released (astro.build)
submitted 9 months ago by to c/astro@programming.dev
22
23
Astro 6 Beta (astro.build)
submitted 9 months ago by to c/astro@programming.dev
24
2025 year in review (astro.build)
submitted 9 months ago by to c/astro@programming.dev
25
view more: next ›