rsnext/docs
Gustavo Steinmetz 9df4e0614e
Update Local Images Example to Use Assets Folder (#47878)
This pull request updates the Local Images example in the Next.js
documentation to use an ``assets`` folder inside the ``src`` directory
instead of the ``public`` folder. The changes are made to emphasize the
recommended practice of organizing and importing static assets when
using the Next.js ``Image`` component.

The previous example could cause confusion as it suggested importing
images from the ``public`` folder, which is generally used for static
files that can be accessed directly via a URL. However, when using the
Next.js ``Image`` component, it is recommended to import images as
modules and store them in a folder like ``assets`` inside the ``src``
directory. This approach allows the Image component to optimize images
and prevent Cumulative Layout Shift while loading.

This PR changes the image import statements as the example below:

```jsx
import profilePic from '@/assets/me.png';
```

These changes aim to provide clearer guidance on how to handle local
images. To avoid misunderstandings while the developer follows the
documentation.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-04-05 04:10:31 +00:00
..
advanced-features [Docs] Update react docs link (#47891) 2023-04-04 11:56:03 -07:00
api-reference [Docs] Update react docs link (#47891) 2023-04-04 11:56:03 -07:00
api-routes chore(docs): update next export to output: 'export' (#47717) 2023-03-31 02:04:23 +00:00
basic-features Update Local Images Example to Use Assets Folder (#47878) 2023-04-05 04:10:31 +00:00
guides [Docs] Update react docs link (#47891) 2023-04-04 11:56:03 -07:00
migrating Update Local Images Example to Use Assets Folder (#47878) 2023-04-05 04:10:31 +00:00
routing [Docs] Update react docs link (#47891) 2023-04-04 11:56:03 -07:00
accessibility.md Add documentation on accessibility. (#38522) 2022-07-14 13:05:39 +00:00
authentication.md Alphabetize auth docs providers. (#34281) 2022-02-13 00:51:53 +00:00
deployment.md Linking to SST Next.js tutorial. (#47752) 2023-03-31 17:13:31 +00:00
faq.md doc: improve a word client side rendering (#39771) 2022-08-22 14:55:46 -05:00
getting-started.md [docs] Update getting-started.md with New react docs link (#47841) 2023-04-03 07:43:34 +00:00
going-to-production.md Fix URL anchor position in going-to-production.md (#47056) 2023-03-13 06:01:37 +00:00
manifest.json Add documentation on OTEL support (#47194) 2023-04-04 14:24:46 +00:00
testing.md Switch to ESM Jest config in docs (#42144) 2023-03-28 00:10:58 +00:00
upgrading.md Docs: next/font updates (#46159) 2023-02-24 05:20:26 +00:00