Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c7fea0b
move `astro/assets/utils` to the `astro:assets` page
ArmandPhilippot Dec 10, 2025
bef2227
consistent headings formatting
ArmandPhilippot Dec 10, 2025
cee5a29
add missing imports for `astro:assets`
ArmandPhilippot Dec 10, 2025
1ec84d5
add `astro:assets` types
ArmandPhilippot Dec 10, 2025
a5ee228
add imports and types from `astro/assets`
ArmandPhilippot Dec 10, 2025
b5a160d
add `astro` types
ArmandPhilippot Dec 11, 2025
6a603f5
add Since for `astro` types
ArmandPhilippot Dec 12, 2025
3e97ffe
add cross-sections links in types
ArmandPhilippot Dec 12, 2025
252e11f
add image services types too since we have helpers using them
ArmandPhilippot Dec 12, 2025
d983c3b
add RemotePattern type, flatten unexported types, rework `getImage()`
ArmandPhilippot Dec 12, 2025
e05bb1a
fix link
ArmandPhilippot Dec 12, 2025
2c238ef
add links to `astro:assets`, replace types displayed as code snippet
ArmandPhilippot Dec 12, 2025
85f222d
simplify `astro/assets/utils` code snippets, part 1
ArmandPhilippot Dec 12, 2025
9bab86a
simplify astro/assets/utils code snippets, part 2
ArmandPhilippot Dec 13, 2025
749b3a9
minor adjustments
ArmandPhilippot Dec 13, 2025
9c39401
Merge branch 'main' into fix/modules/astro-assets
ArmandPhilippot Dec 13, 2025
9160152
Merge branch 'main' into fix/modules/astro-assets
ArmandPhilippot Dec 16, 2025
d6f7527
link back to `inferSize`
ArmandPhilippot Dec 16, 2025
1ff70e2
add back `ImageMetaData` in `guides/images`
ArmandPhilippot Dec 16, 2025
0006687
move `emitESMImage` at the end
ArmandPhilippot Dec 16, 2025
9b6dd2c
limit heading level to h4 / remove Image+Picture props heading
ArmandPhilippot Dec 16, 2025
a9c48ae
fix links due to headings removal
ArmandPhilippot Dec 16, 2025
e9bd756
fix `ru` link
ArmandPhilippot Dec 16, 2025
c5986f4
h3 max
ArmandPhilippot Dec 16, 2025
333cabf
Merge branch 'main' into fix/modules/astro-assets
ArmandPhilippot Dec 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/content/docs/en/guides/images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -488,18 +488,7 @@ The [Astro template syntax](/en/reference/astro-syntax/) also supports writing a

### images in `src/`

Local images must be imported from the relative path from the existing `.astro` file, or you can configure and use an [import alias](/en/guides/imports/#aliases). Then, you can access the image's `src` and other properties to use in the `<img>` tag.

Imported image assets match the following signature:

```ts
interface ImageMetadata {
src: string;
width: number;
height: number;
format: string;
}
```
Local images must be imported from the relative path from the existing `.astro` file, or you can configure and use an [import alias](/en/guides/imports/#aliases). They become available as an [`ImageMetadata` object](/en/reference/modules/astro-assets/#imagemetadata-1) giving you access to the image's `src` and other properties to use in the `<img>` tag.

The following example uses the image's own `height` and `width` properties to avoid Cumulative Layout Shift (CLS) and improve Core Web Vitals:

Expand Down
Loading