-
Notifications
You must be signed in to change notification settings - Fork 23
docs: migrate guides from v1 to v2 Starlight #182
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
Merged
ghostdevv
merged 11 commits into
cloudinary-community:main
from
mohith2883:docs/readd-old-guides
Mar 4, 2026
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fc0b95f
docs: migrate guides from v1 to v2 Starlight
mohith2883 265f484
docs: migrate guides from v1 to v2 Starlight
mohith2883 4aa58a6
docs: migrate guides from v1 to v2 Starlight
mohith2883 625c12e
updated
mohith2883 da2eb3f
Merge branch 'main' into docs/readd-old-guides
ghostdevv bf4461e
Merge remote-tracking branch 'origin/main' into docs/readd-old-guides
ghostdevv 8fdc250
chore: update formatting and slight wording
ghostdevv 24147f2
chore: get rest of guides running
ghostdevv bd529c5
chore: update redirects
ghostdevv 23cc806
fix: file name
ghostdevv a6dd86d
docs: update content
ghostdevv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
packages/docs/src/content/docs/guides/background-removal.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| --- | ||
| title: Guides/Background Removal | ||
| order: 1 | ||
| --- | ||
|
|
||
| <script> | ||
|
ghostdevv marked this conversation as resolved.
Outdated
|
||
|
|
||
| import Callout from '$lib/components/Callout.svelte' | ||
| import { Tabs, Tab} from '$lib/components/Tabs' | ||
| import { CldOgImage, CldImage } from 'svelte-cloudinary' | ||
|
|
||
| </script> | ||
|
|
||
| # Removing a Background from an Image | ||
|
|
||
| The CldImage component allows you to easily remove backgrounds from images using the `removeBackground` prop. | ||
|
|
||
| <Callout emoji={false}> | ||
| Removing backgrounds require enabling the <a href="https://cloudinary.com/documentation/cloudinary_ai_background_removal_addon">Cloudinary AI Background Removal Add-On</a> which includes a free tier for getting started. | ||
| </Callout> | ||
|
ghostdevv marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Example | ||
|
|
||
| <div style="max-width: 500px; margin: 0 auto"> | ||
| <CldImage | ||
|
ghostdevv marked this conversation as resolved.
Outdated
|
||
| width={960} | ||
| height={600} | ||
| src={`images/turtle`} | ||
| sizes="(max-width: 480px) 100vw, 50vw" | ||
| removeBackground | ||
| alt="" | ||
| /> | ||
| </div> | ||
|
|
||
| <Tabs> | ||
| <Tab type="code" open title="CldImage"> | ||
|
ghostdevv marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```svelte | ||
| <script> | ||
| import { CldImage } from 'svelte-cloudinary'; | ||
| </script> | ||
|
|
||
| <CldImage | ||
| width="960" | ||
| height="600" | ||
| src="images/turtle" | ||
| sizes="100vw" | ||
| removeBackground | ||
| alt="Turtle" | ||
| /> | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab title="getCldImageUrl"> | ||
|
|
||
|
ghostdevv marked this conversation as resolved.
Outdated
|
||
| ```html | ||
| <script> | ||
| import { getCldImageUrl } from 'svelte-cloudinary'; | ||
|
|
||
| const cldUrl = getCldImageUrl({ | ||
| width: 960, | ||
| height: 600, | ||
| src: 'images/turtle', | ||
| removeBackground: true | ||
| }); | ||
| </script> | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ## Learn More | ||
|
|
||
| - [CldImage](/cldimage/usage) | ||
| - [getCldImageUrl](/getcldimageurl/usage) | ||
73 changes: 73 additions & 0 deletions
73
packages/docs/src/content/docs/guides/image-optimization.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| title: Guides/Image Optimization | ||
| order: 2 | ||
| --- | ||
|
|
||
| <script> | ||
|
|
||
| import Callout from '$lib/components/Callout.svelte' | ||
| import Video from '$lib/components/Video.svelte' | ||
| import { Tabs, Tab} from '$lib/components/Tabs' | ||
| import { CldOgImage, CldImage } from 'svelte-cloudinary' | ||
|
|
||
| </script> | ||
|
ghostdevv marked this conversation as resolved.
Outdated
|
||
|
|
||
| # Optimizing Images in Svelte/SvelteKit | ||
|
|
||
| Automatically optimize images using the CldImage component. By default, CldImage opts you in to automatic optimization including delivering the most optimal format for the browser (WebP, AVIF). | ||
|
|
||
| You can further optimize delivery by using [responsive sizing](/guides/responsive-images) by using the `sizes` prop. | ||
|
|
||
| ## Example | ||
|
|
||
| <div style="max-width: 500px; margin: 0 auto"> | ||
| <CldImage | ||
| width="960" | ||
| height="600" | ||
| src={`images/turtle`} | ||
| sizes="100vw" | ||
| alt="Turtle" | ||
| /> | ||
| </div> | ||
|
|
||
| <Tabs tabs={['CldImage', 'getCldImageUrl']}> | ||
| <Tab type="code" open title="CldImage"> | ||
|
|
||
| ```svelte | ||
| <script> | ||
| import { CldImage } from 'svelte-cloudinary'; | ||
| </script> | ||
|
|
||
| <CldImage width="960" height="600" src="images/turtle" sizes="100vw" alt="Turtle" /> | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab type="code" title="getCldImageUrl"> | ||
|
|
||
| ```svelte | ||
| <script> | ||
| import { getCldImageUrl } from 'svelte-cloudinary'; | ||
|
|
||
| getCldImageUrl({ | ||
| width: 960, | ||
| height: 600, | ||
| src: 'images/turtle' | ||
| }); | ||
| </script> | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ## Watch & Learn | ||
|
|
||
| <Video | ||
| title="Optimize Images, Responsive Sizing, & AI Cropping in Svelte with Svelte Cloudinary" | ||
| url="https://www.youtube.com/watch?v=Vr3H3XREkbw" | ||
| /> | ||
|
ghostdevv marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Learn More | ||
|
|
||
| - [Responsive Images](/guides/responsive-images) | ||
| - [CldImage](/cldimage/usage) | ||
| - [getCldImageUrl](/getcldimageurl/usage) | ||
121 changes: 121 additions & 0 deletions
121
packages/docs/src/content/docs/guides/image-overlays.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| --- | ||
| title: Guides/Image Overlays | ||
| order: 3 | ||
|
ghostdevv marked this conversation as resolved.
Outdated
|
||
| --- | ||
|
|
||
| <script> | ||
|
|
||
| import Callout from '$lib/components/Callout.svelte' | ||
| import Video from '$lib/components/Video.svelte' | ||
| import { Tabs, Tab} from '$lib/components/Tabs' | ||
| import { CldOgImage, CldImage } from 'svelte-cloudinary' | ||
|
|
||
| </script> | ||
|
|
||
| # Overlaying Images | ||
|
|
||
| You can add images on top of other images by using image-based overlays. | ||
|
|
||
| ## Example | ||
|
|
||
| <div style="max-width: 500px; margin: 0 auto"> | ||
| <CldImage | ||
| width="960" | ||
| height="600" | ||
| src={`images/turtle`} | ||
| sizes="100vw" | ||
| overlays={[{ | ||
| publicId: 'images/earth', | ||
| position: { | ||
| x: 50, | ||
| y: 50, | ||
| gravity: 'north_west', | ||
| }, | ||
| effects: [ | ||
| { | ||
| crop: 'fill', | ||
| gravity: 'auto', | ||
| width: 500, | ||
| height: 500 | ||
| } | ||
| ] | ||
| }]} | ||
| alt="Turtle with earth" | ||
| /> | ||
| </div> | ||
|
|
||
| <Tabs tabs={['CldImage', 'getCldImageUrl']}> | ||
| <Tab type="code" open title="CldImage"> | ||
|
|
||
| ```svelte | ||
| <script> | ||
| import { CldImage } from 'svelte-cloudinary'; | ||
| </script> | ||
|
|
||
| <CldImage | ||
| width="960" | ||
| height="600" | ||
| src="images/turtle" | ||
| sizes="100vw" | ||
| overlays={[ | ||
| { | ||
| publicId: 'images/earth', | ||
| position: { | ||
| x: 50, | ||
| y: 50, | ||
| gravity: 'north_west' | ||
| }, | ||
| effects: [ | ||
| { | ||
| crop: 'fill', | ||
| gravity: 'auto', | ||
| width: 500, | ||
| height: 500 | ||
| } | ||
| ] | ||
| } | ||
| ]} | ||
| alt="Turtle with earth" | ||
| /> | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab type="code" title="getCldImageUrl"> | ||
|
|
||
| ```svelte | ||
| <script> | ||
| import { getCldImageUrl } from 'svelte-cloudinary'; | ||
|
|
||
| const cldUrl = getCldImageUrl({ | ||
| width: 960, | ||
| height: 600, | ||
| src: 'images/turtle', | ||
| overlays: [ | ||
| { | ||
| publicId: 'images/earth', | ||
| position: { | ||
| x: 50, | ||
| y: 50, | ||
| gravity: 'north_west' | ||
| }, | ||
| effects: [ | ||
| { | ||
| crop: 'fill', | ||
| gravity: 'auto', | ||
| width: 500, | ||
| height: 500 | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }); | ||
| </script> | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ## Learn More | ||
|
|
||
| - [CldImage](/cldimage/usage) | ||
| - [getCldImageUrl](/getcldimageurl/usage) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| title: Guides/Image Underlays | ||
| order: 4 | ||
| --- | ||
|
|
||
| <script> | ||
|
|
||
| import Callout from '$lib/components/Callout.svelte' | ||
| import Video from '$lib/components/Video.svelte' | ||
| import { Tabs, Tab} from '$lib/components/Tabs' | ||
| import { CldOgImage, CldImage } from 'svelte-cloudinary' | ||
|
|
||
| </script> | ||
|
|
||
| # Adding Layers Under Images | ||
|
|
||
| Underlays function very similar to overlays in terms of options, however they **do not support text**. | ||
|
|
||
| See the examples above under Overlays to learn more about the available configurations. | ||
|
|
||
| ## Example | ||
|
|
||
| <div style="max-width: 500px; margin: 0 auto"> | ||
| <CldImage | ||
| width="960" | ||
| height="600" | ||
| src={`images/turtle`} | ||
| sizes="100vw" | ||
| removeBackground | ||
| underlay="images/galaxy" | ||
| alt="Turtle swimming in a galaxy" | ||
| /> | ||
| </div> | ||
|
|
||
| <Tabs tabs={['CldImage', 'getCldImageUrl']}> | ||
| <Tab type="code" open title="CldImage"> | ||
|
|
||
| ```svelte | ||
| <script> | ||
| import { CldImage } from 'svelte-cloudinary'; | ||
| </script> | ||
|
|
||
| <CldImage | ||
| width="960" | ||
| height="600" | ||
| src="images/turtle" | ||
| sizes="100vw" | ||
| removeBackground | ||
| underlay="images/galaxy" | ||
| alt="Turtle swimming in a galaxy" | ||
| /> | ||
| ``` | ||
|
|
||
| </Tab> | ||
| <Tab type="code" title="getCldImageUrl"> | ||
|
|
||
| ```svelte | ||
| <script> | ||
| import { getCldImageUrl } from 'svelte-cloudinary'; | ||
|
|
||
| const cldUrl = getCldImageUrl({ | ||
| width: 960, | ||
| height: 600, | ||
| src: 'images/turtle', | ||
| removeBackground: true, | ||
| underlay: 'images/galaxy' | ||
| }); | ||
| </script> | ||
| ``` | ||
|
|
||
| </Tab> | ||
| </Tabs> | ||
|
|
||
| ## Learn More | ||
|
|
||
| - [CldImage](/cldimage/usage) | ||
| - [getCldImageUrl](/getcldimageurl/usage) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.