Skip to content

Commit 8180008

Browse files
authored
fix: CDN option for Unpic (#23)
# Description Adds the `cdn` prop to help Unpic understand our transformer is Cloudinary based. ## Issue Ticket Number Fixes #22 <!-- Specify above which issue this fixes by referencing the issue number (`#<ISSUE_NUMBER>`) or issue URL. --> <!-- Example: Fixes https://github.com/cloudinary-community/svelte-cloudinary/issues/<ISSUE_NUMBER> --> ## Type of change <!-- Please select all options that are applicable. --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Fix or improve the documentation - [ ] This change requires a documentation update # Checklist <!-- These must all be followed and checked. --> - [ ] I have followed the contributing guidelines of this project as mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md) - [ ] I have created an [issue](https://github.com/cloudinary-community/svelte-cloudinary/issues) ticket for this PR - [ ] I have checked to ensure there aren't other open [Pull Requests](https://github.com/cloudinary-community/svelte-cloudinary/pulls) for the same update/change? - [ ] I have performed a self-review of my own code - [ ] I have run tests locally to ensure they all pass - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes needed to the documentation
1 parent 2aecdad commit 8180008

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

svelte-cloudinary/src/lib/components/CldImage.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,15 @@
7171
<Image
7272
{...$$props}
7373
{...imageProps}
74+
cdn="cloudinary"
7475
transformer={({ width, url, height}) => {
75-
return getCldImageUrl({
76+
return getCldImageUrl({
7677
...imageProps,
7778
...cldOptions,
7879
width,
7980
height,
80-
src:url
81+
// @ts-ignore
82+
src: url
8183
})}
8284
}
83-
src={url}
8485
/>

0 commit comments

Comments
 (0)