We have released another rather large update to our platform. This time we have added templating support. This lays the foundation for our templating feature set and is only the beginning. Expect many more things around templating to come in the future.
Along with templating support, we have added our PDF template gallery and Image template gallery. Which features all of the available public templates that you can use. We will be expanding the number of templates in the gallery over time.
Using templates is a much easier way to generate PDFs and Images than just using standard HTML. We still support HTML and always will, however using a template all you need to do is specify the templateId and pass in your data, and that's it. The implementation is significantly easier to maintain and implement.
We also support custom templates, which allow you to generate your own template using the Nunjucks templating syntax, and TailWind CSS. We inject the TailWind CSS for you and handle the Nunjucks templating. All you need to do is provide the template and the data.
In a future release, we will be adding support for you to upload your own templates, so you can use private templates, and pass in your templateId much the same way you would for using a public template from the template gallery.
If you are interested in using the new templating system, look at our templating docs to get started.
In addition to templating, we have also added thumbnail generation capabilities to the PDF and Image endpoints. This lets you generate thumbnail versions of your asset as an image. You can specify the dimensions, quality, and format of the image and serve it from your cloudlayer.io storage account as normal.
To see the full set of changes in this release take a look at the changelog.