Repository navigation
Conversation
- An <img src="{{x}}"> or CSS url({{x}}) is an image field. The render
fetches, checks and embeds each image (an https URL, a data:image URI or
an upload); a 404 or a page that is not an image is a 422 naming the
field. Limits: 2 MB per image, 4 MB of images per document.
- <img data-logo="client.website"> shows the company logo for a website:
from logo.dev when LOGO_DEV_SECRET_KEY is set, else from the built-in
brand library (exact website matches only), then the site's own icon.
Nothing found leaves the image out, with a warning in the render
response. data-logo-shape and data-logo-theme pick the version. Lookups
are kept in storage, found for 30 days and missed for one.
- An upload used in a render is kept for 30 days after its last use.
- Editor: image and website fields under Variables; a click on an image or
logo slot points at its sample; Make variable works on images and can
turn one into a company logo slot, with shape and background options.
- The quote template shows the client's logo from client.website.
- Fix: inline text edits and image swaps on the canvas were not saved.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes
Image variables. A variable used as a whole image source (
<img src="{{client.logo}}">orurl({{hero}})) is listed by/fieldswith typeimage. At render, each image is fetched, checked and embedded in the PDF: anhttpsURL, adata:imageURI, or an upload of the app (assets/<key>). One that can't be used fails the render with a422naming it, for exampleclient.logo: image could not be loaded (HTTP 404), instead of printing a blank. Limits: 2 MB per image, 4 MB of images per document (render time grows with them: about 8 s for 1.9 MB, 17 s for 3.7 MB and 45 s for 5.6 MB through the PDF service).Company logos from a website.
<img data-logo="client.website">shows the logo of the company whose website the value names (acme.com,https://www.acme.com/aboutorjane@acme.com)./fieldslists it with typewebsite.LOGO_DEV_SECRET_KEY(declared underenv.optional), then the built-in brand library, then the site's own icon (an SVG, or a raster of at least 64 px).harbor.comreturns an unrelated project called Harbor), and a guess never counts here.data-logo-shape(squareorfull) anddata-logo-theme(lightordark) pick the version. Shape applies with logo.dev. Without it the brand's main logo is used, or its dark-background version where it has one: the library's wordmarks often have white lettering.warningsentry. A value that is not a website (Acme Inc) is a422.logos/, found for 30 days and missed for one, separately for logo.dev and the free sources.client.website.Uploads. An upload used in a render is kept for 30 days after its last use (
assets.last_used_at, an additive column), so an agent can upload a logo once and keep rendering with it.Editor.
Fix. Inline text edits and image swaps on the canvas were not saved: the canvas message handler is bound once and read the deck id from the first render, where it is still null.
Testing
vite buildOK.Acme Incgave a 422;