Come build with us.
Stacks API v13 for Stacks 5.0
assets
assets
Array
An array of asset dictionaries.
An array of asset files declarations.
Each line in the assets array should be a dictionary. And each dictionary should represent an asset file/folder to be published.
Assets, Templates, and Libraries are similar. Each can contain content and files to be published. But each imply different behavior and should be used differently.
Assets are NOT processed for templates. They are NOT included in edit-mode. Assets should be used whenever possible. They are simple and low-cost.
Libraries are NOT processed for templates. Some libraries are included in edit-mode. Some libraries are built-in to stacks (e.g. jQuery and FontAwesome). Libraries are shared between all stacks on the site/page. Use a library whenever you need to share common content between stacks.
Templates ARE processed for template variables. Some templates are included in edit-mode. Since templates must be processed you should include as few templates as possible – move as much of your content to assets or libraries whenever you can.
The asset dictionary can include the following keys:
filename
The filename of the asset. Do not include the path to the file.
Note: The filename can refer to an entire folder. All content inside the folder will be published.
siteAsset
(Boolean – defaults to NO)Normal assets are published, along with the page. Site assets are just once for the whole site and shared among all pages. They are published to the Stacks common directory for the site. To refer to the them you should use the %siteAssetPath%
template variable
Note: It’s up to you to ensure that the items have acceptable web-friendly naming and do not conflict with other files that might be present in other elements.