Reputation: 41
I am working with PUG template engine,Unable to insert image. I have my image stored in current folder where this file is stored. Any help would be appreciated. Unable to load image. Following is the code written for image.
img(src='./login_icon', alt='login', style='width:100px;height:100px;')
Upvotes: 2
Views: 16231
Reputation: 51
What I can see in your example is that it doesn't have the image extension.
img(src='./login_icon.svg' alt='login' style='width:100px;height:100px;')
Check that and also the path of it.
Upvotes: 0
Reputation: 1
If you're working on node.js. move to your server.js and add this code.
app.use('/pictures', express.static(process.cwd() + '/pictures'));
where pictures is the picture folder
img(src='./Pictures/pic1')
this in your .pub file
Upvotes: 0
Reputation: 51
It should be:
img(src='./login_icon' alt='login' style='width:100px; height:100px;')
Simply remove the comma.
Upvotes: 5