Skip to content

Commit

Permalink
fix(gatsby): support multiple instances of same variable in gatsbyIma…
Browse files Browse the repository at this point in the history
…ge placeholderUrl (#38626) (#38647)

(cherry picked from commit b177db9)

Co-authored-by: Carlos Fernandes Cunha <cunhacf@users.noreply.github.com>
  • Loading branch information
gatsbybot and cunhacf committed Oct 20, 2023
1 parent 8302bc8 commit 02e925a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function generatePlaceholderUrl({
const aspectRatio = originalWidth / originalHeight

return url
.replace(`%width%`, String(width))
.replace(`%height%`, Math.floor(width / aspectRatio).toString())
.replace(`%quality%`, String(quality))
.replaceAll(`%width%`, String(width))
.replaceAll(`%height%`, Math.floor(width / aspectRatio).toString())
.replaceAll(`%quality%`, String(quality))
}

0 comments on commit 02e925a

Please sign in to comment.