Skip to content

Commit

Permalink
Resolves #56 - srcset and sizes only reference cropped versions
Browse files Browse the repository at this point in the history
  • Loading branch information
reneweiser committed Sep 15, 2020
1 parent 92695d8 commit 70a6e88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/wpResponseParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function processImage(imageObject) {
caption: imageObject.caption,
description: imageObject.description,
srcset: createSrcString(imageObject),
sizes: createSrcSizes(imageObject),
sizes: createSrcSizes(),
};
}

Expand All @@ -217,17 +217,17 @@ function createSrcString(imageObject) {
`${imageObject.sizes.thumbnail} 500w`,
`${imageObject.sizes.medium} 1000w`,
`${imageObject.sizes.large} 2000w`,
`${imageObject.url} ${imageObject.width}w`,
`${imageObject.sizes.huge} 3000w`,
].join(",");
}

// Needs more work
function createSrcSizes(imageObject) {
function createSrcSizes() {
return [
"(max-width: 500px) 500px",
"(max-width: 1000px) 1000px",
"(max-width: 2000px) 2000px",
`${imageObject.width}px`,
"(max-width: 3000px) 3000px",
].join(",");
}

Expand Down

0 comments on commit 70a6e88

Please sign in to comment.