connectapi
connectapi copied to clipboard
feat: new function `set_content_image()`, deprecate old `set_image_*` functions
Fixes #294 Fixes #304
- Deprecate
set_image_path(content, path)
,set_image_url(content, url)
,set_image_webshot(content)
. - Add a new function,
set_content_image(content, path)
. The new function can handle a local file path or a remote URL. If the path points to a local file that exists, it will use that. Otherwise, if it is anhttps
orhttp
URL, it will attempt to download that image to a temporary file and use that (the old behavior ofset_image_url()
.
In a future PR to the connect
repo, set_image_webshot()
will become a recipe in the SDK Cookbook.
Note: this wasn't based off the 0.3.0 release, so the NEWS will have a merge conflict once that PR has merged. Not sure why I started it from main
, but I did 🤷🏻.
Replaces #302, which I accidentally closed with a force push.