Welcome to Fragmentor v4. Still working in v3?Switch to v3
  1. Docs
  2. Assets

Assets

An asset is a file the site uses as it is, like an image, a font, a shared stylesheet or script, or a download.

Assets are stored in /assets/, in any folder structure. The build copies each one into the site without the /assets prefix:

FileURL
/assets/main.css/main.css
/assets/fonts/inter.woff2/fonts/inter.woff2
/assets/images/logo.png/images/logo.png
/assets/integrations/cart.js/integrations/cart.js

A component links an asset by its URL, not by its path in the project.

<!-- /components/Page.html -->
<head>
  <link rel="stylesheet" href="/main.css">
  <script src="/integrations/cart.js" defer></script>
</head>
<body>
  <img src="/images/logo.png" alt="Shadow Dojo">
</body>

The same goes for an image field in a document: its src is /images/logo.png.

Priority

An asset takes precedence over a page or a generated file at the same URL. Put your own robots.txt or sitemap.xml in /assets/ to replace the generated one.