Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pug image as a link

Tags:

node.js

pug

how do you make an image a link in Pug I've tried

   a(href='https://github.com/LouieAdamian') img(src="/img/GitHub.png")

and

img(src="/img/GitHub.png")
a(href='https://github.com/LouieAdamian')

and

a(href='https://github.com/LouieAdamian')
img(src="/img/GitHub.png")

none of these worked I ether ended up with the text img(src="/img/GitHub.png") as the link or no link at all.

like image 936
Louie Adamian Avatar asked Apr 26 '17 18:04

Louie Adamian


Video Answer


1 Answers

This way (the indent is necessary):

a(href='https://github.com/LouieAdamian')
  img(src="/img/GitHub.png")
like image 96
luisenrike Avatar answered Sep 28 '22 08:09

luisenrike