to make...">

Jade Templates: Make Image Link

So, in HTML, I would do something like this:

<a href="www.something.com"> <img src="my/machine"> </a> 

to make the image into a link. But I want to do the same for Jade. I read the docs here , but didn't say anything about what I want. Please help me? Thank you very much in advance.

+7
javascript pug
source share
2 answers

What you do is nested elements. Nesting only requires new lines and tabs at the socket level.

Jade:

 a(href='www.something.com') img(src='my/machine') 
+9
source share

Use img(src= someExpr) , where someExpr will be evaluated along the path to your image.

0
source share

All Articles