EDIT: I have updated my question below with different information
I am struggling here because I’ve used the @asset
directive with ease in previous sage sites. For whatever reason, two things are happening:
- the image the templates aren’t using the hashed file name on with
yarn build
-
yarn dev
all assets are moved without a hash on the file name, but everything is put in the rootpublic
folder while the HTML references images with theimages
subfolder.
Here’s what I have done
- Included
line-separator.png
in myresources/images
folder - Created a reference to this file
<img class="img-fluid" src="@asset('images/line-separator.png')">
- ran
yarn build
- Tried to load the page
The image does not load.
5. ran yarn dev
Noticed it created a file without the hash in the public
folder, but the image still doesn’t load.
- The full path to the image is
http://www.demosite.test/app/themes/alk/public/images/line-separator.png
However on yarn dev
it’s moving all files directly to the public
folder without the images
subfolder.
- So why isn’t the blade template being rendered with the hashed file name on images
- Should the template remove the
images
subfolder reference or is the build not moving images to their proper subfolders?