Images & assets
Assets are files stored in your workspace that templates can use: logos, signatures, background images and shared stylesheets. Each asset has an alias, a name you choose that templates use to refer to it.
Uploading
Section titled “Uploading”In the app, open Templates → Assets and click Upload. Choose the file and an alias
such as logo.
Through the API, send a multipart form to POST /v1/assets:
curl https://api.doquill.com/v1/assets \ -H "Authorization: Bearer $DOQUILL_API_KEY" \ -F "file=@logo.svg" \ -F "alias=logo"| Allowed types | PNG, JPEG, GIF, WebP, SVG and CSS |
|---|---|
| Maximum size | 10 MB per file |
| Alias | Unique within the workspace. tailwind is reserved. |
Using an asset
Section titled “Using an asset”Reference it with the asset function, which returns a URL
to the file:
<img src="{{ asset "logo" }}" alt="Northwind Studio" class="logo">.cover { background-image: url({{ asset "cover" }});}Publishing fails with unknown asset reference when a template references an alias that
doesn’t exist, so a typo can’t reach production.
Changing an asset
Section titled “Changing an asset”Replace file (or PUT /v1/assets/{id} with a new file) uploads new content under the
same alias. Rename changes the alias; templates using the old alias must be updated.
Published template versions pin the exact content of every asset they use. Replacing a logo doesn’t change documents rendered from an already published version: publish the template again to pick it up. The editor shows a notice on templates whose assets changed since their last publish.
Stylesheets
Section titled “Stylesheets”A CSS asset is a shared stylesheet. Turn it on per template in the template’s Styles tab, or for every template with Apply to all templates. See Styling & Tailwind.
Images in HTML output
Section titled “Images in HTML output”For PDF, PNG, JPEG and DOCX output, images are embedded in the document. HTML output links to them instead, and those links expire after 5 minutes. If you keep rendered HTML, render it to PDF instead, or download the images when you receive it.
Data URIs and external images
Section titled “Data URIs and external images”Images must come from your workspace’s assets. The renderer blocks network access, so
<img src="https://…"> from another site doesn’t load, and neither does an image inlined
as a data: URI. Inline SVG markup in the template works, as does the SVG returned by
the code functions.