fix: correct netlify config
This commit is contained in:
committed by
Michael Zetterberg
parent
274e203335
commit
6a80deefeb
4
.gitignore
vendored
4
.gitignore
vendored
@@ -35,4 +35,6 @@ yarn-error.log*
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
certificates
|
||||
certificates
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
|
||||
@@ -10,3 +10,4 @@ app/scandic.css
|
||||
netlify.toml
|
||||
package.json
|
||||
package-lock.json
|
||||
.gitignore
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
import { gql } from "graphql-request"
|
||||
import { request } from "@/lib/request"
|
||||
import NextImage from "next/image"
|
||||
import Image from "../../../../components/Image"
|
||||
import { insertResponseToImageVaultAsset } from "@/utils/imageVault"
|
||||
import type { InsertResponse } from "@/types/requests/imagevault"
|
||||
|
||||
type TestImageData = {
|
||||
lopeztest: {
|
||||
json_rte: { json: JSON }
|
||||
customdam: InsertResponse
|
||||
}
|
||||
}
|
||||
|
||||
const query = gql`
|
||||
query MyQuery {
|
||||
lopeztest(uid: "blt0b6d8eaa08d72c46") {
|
||||
json_rte {
|
||||
json
|
||||
}
|
||||
customdam
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export default async function TestImagePage() {
|
||||
const response = await request<TestImageData>(query)
|
||||
|
||||
const data = response.data?.lopeztest
|
||||
const customImage = insertResponseToImageVaultAsset(data.customdam)
|
||||
|
||||
return (
|
||||
<div style={{ padding: 40 }}>
|
||||
<NextImage
|
||||
src={customImage.url}
|
||||
title={customImage.title}
|
||||
alt={customImage.meta.alt ?? customImage.title}
|
||||
width={400}
|
||||
height={400}
|
||||
quality={10}
|
||||
style={{ objectFit: "contain" }}
|
||||
/>
|
||||
<Image
|
||||
src={customImage.url}
|
||||
title={customImage.title}
|
||||
alt={customImage.meta.alt ?? customImage.title}
|
||||
width={400}
|
||||
height={400}
|
||||
quality={10}
|
||||
style={{ objectFit: "contain" }}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
11
netlify.toml
11
netlify.toml
@@ -24,14 +24,3 @@ package = "@netlify/plugin-nextjs"
|
||||
|
||||
[images]
|
||||
remote_images = ["https://imagevault-stage.scandichotels.com.*", "https://imagevault.scandichotels.com.*"]
|
||||
|
||||
[[redirects]]
|
||||
from = "/_next/image"
|
||||
to = "/.netlify/images?url=:url&w=12344&q=:quality"
|
||||
status = 200
|
||||
|
||||
[redirects.query]
|
||||
url = ":url"
|
||||
w = ":width"
|
||||
q = ":quality"
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ const nextConfig = {
|
||||
protocol: "https",
|
||||
hostname: "imagevault-stage.scandichotels.com",
|
||||
},
|
||||
{
|
||||
protocol: "https",
|
||||
hostname: "imagevault.scandichotels.com",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { ImageVaultAsset, InsertResponse } from "@/types/requests/imagevault"
|
||||
import {
|
||||
ImageVaultAsset,
|
||||
InsertResponse,
|
||||
} from "@/types/components/imageVaultImage"
|
||||
|
||||
export function insertResponseToImageVaultAsset(
|
||||
response: InsertResponse
|
||||
|
||||
Reference in New Issue
Block a user