jacksleight / statamic-raster
Rasterise views and partials to images by simply adding a tag and fetching the URL.
Package info
github.com/jacksleight/statamic-raster
Language:Antlers
pkg:composer/jacksleight/statamic-raster
Fund package maintenance!
Requires
- php: ^8.2
- jacksleight/laravel-raster: ^1.0
- statamic/cms: ^6.0
Requires (Dev)
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Raster
Rasterise views and partials to images by simply adding a tag and fetching the URL. Automatic routing, scaling, caching, protection and preview mode. Zero configuration (unless you need it).
Example
Add the raster tag to a view, the current entry's data is passed to it automatically:
{{# resources/views/blog/hero.antlers.html #}} {{ %raster width="1000" }} <div> <svg>...</svg> <h1>{{ title }}</h1> <p>{{ date }}</p> </div>
Then fetch the URL with the raster:url tag:
{{# resources/views/blog/show.antlers.html #}} {{ push:head }} <meta property="og:image" content="{{ raster:blog/hero }}"> {{ /push:head }}
Documentation
Sponsoring
This addon is completely free to use. However fixing bugs, adding features and helping users takes time and effort. If you find this addon useful and would like to support its development any contribution would be greatly appreciated. Thanks! 🙂