Tags
Tags group collections so you can render or list a subset with --tag. Learn how root tag definitions and collection tags relate, and how init generates them.
Tags let you render or list a group of collections without naming each one. For example, render everything for iOS, or only social images.
{
"version": 1,
"name": "My App",
"tags": [
{ "id": "ios", "label": "iOS" },
{ "id": "web", "label": "Web" }
],
"collections": [
{ "id": "screenshots", "tags": ["ios"], "...": "..." },
{ "id": "icon", "tags": ["ios", "web"], "...": "..." },
{ "id": "og-images", "tags": ["web"], "...": "..." }
]
}- Root
tagsis a registry of{ id, label }definitions.open-assets listprints their ids at the top. - Collection
tagsis an array of tag ids. This is what filtering uses.
Filtering
npx open-assets render --tag ios
npx open-assets list --tag webA collection matches when its tags array contains the tag exactly (case sensitive). --tag combines with --collection, --template, --size and --locale. If no collection matches, the command exits with an error (No collections matched tag "ios" in config for render, No collections found with tag "ios" for list).
How init sets tags
open-assets init tags each collection with its asset type plus the platforms you picked (for example ["screenshots", "ios"]), and fills the root registry with every tag used, labelled by capitalizing the id (ios becomes Ios). Edit the labels freely.
Gotchas
- Matching uses collection
tagsonly. A tag on a collection that is not in the root registry still filters fine, and nothing checks the two lists against each other. - The dev server does not filter by tags; it shows every collection.
Related
Last updated on
Outputs
Where Open Assets writes rendered images: export sizes, the default folder layout, outFile with template and locale placeholders, JPEG, Xcode and copy-source.
The lockfile
How assets.lock makes renders incremental: what is checksummed, which changes trigger a re-render, what does not, when to use --force and why to commit it.