Skip to content

Commit

Permalink
docs: ✏️ Added page about external images
Browse files Browse the repository at this point in the history
  • Loading branch information
dc7290 committed Jun 12, 2022
1 parent b84dc5d commit 36422cc
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 14 deletions.
1 change: 1 addition & 0 deletions docs/docs/01-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This makes it possible to build a high performance website with this solution, w
- Optimize images at build time.
- All options for `next/image` available
- Convert formats (png → webp, etc.)
- Download external images locally.
- Using `sharp`, so it's fast.
- Cache prevents repeating the same optimization
- Support TypeScript
33 changes: 33 additions & 0 deletions docs/docs/03-Features/01-external-images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
description: This page introduces the handling of external images.
---

# External images

This feature automatically downloads images locally if an external image URL is specified in src.
This, like the other features, works at build time and does not affect development speed.

## Usage

```jsx
<Image src="https://next-export-optimize-images.vercel.app/og.png" width="1280" height="640" alt="" />
```

When in production, it will be rendered as follows. (Only important parts are shown.)

```jsx
<img
srcset="/_next/static/chunks/images/og_1920_75.png 1x, /_next/static/chunks/images/og_3840_75.png 2x"
src="/_next/static/chunks/images/og_3840_75.png"
/>
```

During development, as with local images, no optimization is performed.
Also, no downloading to local is performed.

```jsx
<img
srcset="https://next-export-optimize-images.vercel.app/og.png?width=1920 1x, https://next-export-optimize-images.vercel.app/og.png?width=3840 2x"
src="https://next-export-optimize-images.vercel.app/og.png?width=3840"
/>
```
9 changes: 9 additions & 0 deletions docs/docs/03-Features/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"position": 3,
"className": "red",
"link": {
"type": "generated-index",
"title": "Features",
"description": "List of Main Features."
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"position": 3,
"position": 4,
"className": "red",
"link": {
"type": "generated-index",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 0 additions & 13 deletions docs/docs/08-planned-features.md

This file was deleted.

File renamed without changes.
10 changes: 10 additions & 0 deletions docs/docs/09-planned-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
description: This page is to introduce examples of use.
draft: true
---

# Planned Features

:::caution
There API is in the planning stage and is subject to change in practice.
:::

1 comment on commit 36422cc

@vercel
Copy link

@vercel vercel bot commented on 36422cc Jun 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.