Images
matteobaccan opened this issue · 1 comments
Hi
I have tried to put images inside the boilerplate (src\assets\images) and use it, without success.
I have not understood how to refer to the images
I have also removed style="display: none" from image inside index.ejs: but I don't see the sprite.svg.
So: I don't understand how to put and use images inside boilerplate
Can you explain the right way to use images?
ciao
matteo
Hi
I have not understood how to refer to the images
You can either import them in JS files and get their source url:
frontend-boilerplate/src/test/test.js
Line 5 in 3e9e678
or directly in the ejs template file:
<img src="./assets/images/your-image.jpg" alt="" />
I have also removed style="display: none" from image inside index.ejs: but I don't see the sprite.svg.
The sprite.svg file is grouping several svg into one (gathered from images/sprites
and image import with a ?sprite
query import svgSprite from "./test.svg?sprite";
) and only contains symbols that you can use as:
<svg><use xlink:href="/sprite.svg?#test"></use></svg>
You can find all the different ways of importing modules and assets here:
frontend-boilerplate/src/test/test.js
Lines 1 to 74 in 3e9e678