Skip to content

Commit

Permalink
Add Steps component to dynamically-importing-images.mdx (#8120)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: HiDeoo <[email protected]>
Co-authored-by: Reuben Tier <[email protected]>
  • Loading branch information
4 people authored May 2, 2024
1 parent 645523f commit 09bd14e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/content/docs/en/recipes/dynamically-importing-images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Learn how to dynamically import images using Vite's import.meta.glo
i18nReady: true
type: recipe
---
import { Steps } from '@astrojs/starlight/components';
import { FileTree } from '@astrojs/starlight/components';

Local [images](/en/guides/images/) must be imported into `.astro` files in order to display them. There will be times where you will want or need to dynamically import the image paths of your images instead of explicitly importing each individual image.
Expand All @@ -12,6 +13,7 @@ In this recipe, you will learn how to dynamically import your images using Vite'

## Recipe

<Steps>
1. Create a new `assets` folder under the `src` directory and add your images inside that new folder.

<FileTree>
Expand Down Expand Up @@ -150,5 +152,4 @@ In this recipe, you will learn how to dynamically import your images using Vite'
age={25}
/>
```


</Steps>

0 comments on commit 09bd14e

Please sign in to comment.