fastnsupports bunch of image file formats, checkout supported-image-formats to read about it. The link is shared in the description.
.ftdextensions in your package are called
index.ftddocuments makes for a complete package. But a package can have
nnumber of other documents as well.
In this package, I have put all the images in the folder called
assetsas a foreign variable provided by
fastnand this variable can be used to access the images or other files in the package.
-- import: <package-name>/assets
ftd.imageand passing the file path in
src. So we will write:
-- ftd.image: src: $assets.files.images.<image-file-name-with-extension>
$. $ is used for reference to assets.
files here is used to access the files present in the package.
And anything after
files, it is the path to the file.
ftd.imagedoes not take any body so to avoid throwing error, so we will wrap this text in the markdown component provided by doc-site.
width, border, shadow, etc.
tempinside the images folder, and put this image file we are using inside it. Then we need to change the path as
-- ftd.image: src: $assets.files.images.temp.<image-file-name-with-extension>
We can use two separate images for light and dark mode. For that, we just need
to add the image with same file name followed by
-dark at the same location.
src. But it is recommended to download the image and import it through assets.
-- ftd.image: src: https://upload.wikimedia.org/wikipedia/commons/c/ca/A_Beautiful_Scenery.jpg
Thank you guys, keep watching these videos to learn more about fastn.Support us by giving a star ⭐ on GitHub and join our fastn community on Discord.