Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Steps component to dynamically-importing-images.mdx #8120

Merged
Merged
Changes from all commits
Commits
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
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>
Loading