Assets

Static Files

Static files like images and PDFs can be stored in the top level assets/ directory. You can reference these assets from any template from the root of the site, for example: <img src="/assets/my-image.jpg" />

You can also use a path relative to the specific template. For instance if you were adding an image to layouts/components/my-component.svelte, you could reference the same image like <img src="../../assets/my-image.jpg" /> if you'd like. 

Media Browser

When referencing assets in your JSON content source, you should use the full path (e.g. assets/path/to/file.jpg) instead of just the filename and then hardcoding the prefex and suffix in your template. This allows the Plenti CMS to recognize the file as an asset and gives you a widget for interacting with the Media Browser to change assets or upload new ones. 

The nested folder structure you use inside your top-level assets folder becomes the filtering mechanism of the Media Browser. This can be used for narrowing down results in the Library view or setting the path of new files in the Upload view. Note that only folders with a file inside of them will appear this way (similar to how Git doesn't tracking empty folders).