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

feat: support aws amplify provider #1112

Merged
merged 9 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
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
52 changes: 52 additions & 0 deletions docs/content/3.providers/aws-amplify.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: AWS Amplify
description: Nuxt Image has first class integration with AWS Amplify Hosting
links:
- label: Source
icon: i-simple-icons-github
to: https://github.com/nuxt/image/blob/main/src/runtime/providers/awsAmplify.ts
size: xs
---

Integration between [AWS Amplify Hosting](https://aws.amazon.com/amplify/) and the image module.

This provider will be enabled by default in AWS Amplify deployments.

::alert{type="warning"}
This is an experimental preset and will be available soon! 🚀
::

## Domains

To use external URLs (images not in `public/` directory), hostnames should be whitelisted.

**Example:**

```ts [nuxt.config]
export default {
image: {
domains: [
'avatars0.githubusercontent.com'
]
}
}
```

## Sizes

Specify any custom `width` property you use in `<NuxtImg>`, `<NuxtPicture>` and `$img`.

If a width is not defined, image will fallback to closest possible width.

**Example:**

```ts [nuxt.config]
export default {
image: {
screens: {
icon: 40,
avatar: 24
}
}
}
```
19 changes: 19 additions & 0 deletions docs/public/providers/aws-amplify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export default defineNuxtConfig({
aliyun: {
baseURL: 'https://assets.yanbot.tech'
},
awsAmplify: {
baseURL: 'https://example.amplifyapp.com/_amplify/image'
},
twicpics: {
baseURL: 'https://demo.twic.pics/'
},
Expand Down
10 changes: 10 additions & 0 deletions playground/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ export const providers: Provider[] = [
}
]
},
// AWS Amplify
{
name: 'awsAmplify',
samples: [
{
src: '/test.jpg',
width: 300
}
]
},
// Cloudflare
{
name: 'cloudflare',
Expand Down
Loading