Skip to content

Commit ba12dc6

Browse files
authored
fix(site): allow for remote images (#7769)
1 parent 28df8b8 commit ba12dc6

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

apps/site/next.config.mjs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ const BLOG_ORIGIN_HOST = (() => {
2020
}
2121
})();
2222

23+
const imageRemoteHostnames = [
24+
"cdn.sanity.io",
25+
"prisma.io",
26+
"www.prisma.io",
27+
DOCS_ORIGIN_HOST,
28+
BLOG_ORIGIN_HOST,
29+
];
30+
2331
if (
2432
process.env.NODE_ENV === "production" &&
2533
(!process.env.NEXT_DOCS_ORIGIN || !process.env.NEXT_BLOG_ORIGIN)
@@ -246,12 +254,10 @@ const config = {
246254
reactStrictMode: true,
247255
images: {
248256
unoptimized: false,
249-
remotePatterns: [
250-
{
251-
protocol: "https",
252-
hostname: "cdn.sanity.io",
253-
},
254-
],
257+
remotePatterns: imageRemoteHostnames.map((hostname) => ({
258+
protocol: "https",
259+
hostname,
260+
})),
255261
},
256262
transpilePackages: ["@prisma/eclipse"],
257263
async redirects() {

apps/site/src/components/support/search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function SearchResultItem({ item, onClick }: SearchResultItemProps): ReactNode {
5959
<div className="relative aspect-video w-full overflow-hidden rounded-square bg-background-neutral">
6060
{post.heroImagePath ? (
6161
<Image
62-
src={withSiteBasePathForImageSrc(post.heroImagePath)}
62+
src={post.heroImagePath}
6363
alt={post.content}
6464
fill
6565
sizes="(min-width: 640px) 160px, 128px"

0 commit comments

Comments
 (0)