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

THEMES-1479: #767

Merged
merged 1 commit into from
Oct 31, 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
6 changes: 3 additions & 3 deletions src/components/MetaData/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const globalContentComplete = {
},
promo_items: {
basic: {
url: "awesome-url",
url: "https://awesome-url/image.jpg",
alt_text: "alt text",
},
},
Expand Down Expand Up @@ -73,7 +73,7 @@ const globalContentLeadArt = {
promo_items: {
lead_art: {
type: "image",
url: "awesome-url",
url: "https://awesome-url/image.jpg",
},
},
};
Expand All @@ -85,7 +85,7 @@ const globalContentLeadArtWithResize = {
0x0: "I0HK-BD7QKeAN9drBwVrYoryXDE=filters:format(jpg):quality(70):focal(3699x534:3709x544)/",
},
type: "image",
url: "awesome-url",
url: "https://awesome-url/image.jpg",
},
},
};
Expand Down
7 changes: 3 additions & 4 deletions src/components/MetaData/promoImageHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ export const getImgURL = (metaValue, metaType = "og:image", globalContent, resiz
// eslint-disable-next-line @typescript-eslint/no-var-requires,global-require
const Thumbor = require("thumbor-lite");
const thumbor = new Thumbor(RESIZER_SECRET_KEY, resizerURL);
const imgSrc = _url
.replace(/^http[s]?:\/\//, "")
.replace(" ", "%20")
.replace("?", "%3F");
const imgSrc = new URL(_url)
.toString()
.replace(/^http[s]?:\/\//, "");
/*
We need the focal point out of the resize options to use as a filter
for the thumbor image being used here
Expand Down