fix: correct netlify config
This commit is contained in:
committed by
Michael Zetterberg
parent
274e203335
commit
6a80deefeb
2
.gitignore
vendored
2
.gitignore
vendored
@@ -36,3 +36,5 @@ yarn-error.log*
|
|||||||
next-env.d.ts
|
next-env.d.ts
|
||||||
|
|
||||||
certificates
|
certificates
|
||||||
|
# Local Netlify folder
|
||||||
|
.netlify
|
||||||
|
|||||||
@@ -10,3 +10,4 @@ app/scandic.css
|
|||||||
netlify.toml
|
netlify.toml
|
||||||
package.json
|
package.json
|
||||||
package-lock.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]
|
[images]
|
||||||
remote_images = ["https://imagevault-stage.scandichotels.com.*", "https://imagevault.scandichotels.com.*"]
|
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",
|
protocol: "https",
|
||||||
hostname: "imagevault-stage.scandichotels.com",
|
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(
|
export function insertResponseToImageVaultAsset(
|
||||||
response: InsertResponse
|
response: InsertResponse
|
||||||
|
|||||||
Reference in New Issue
Block a user