How to add a GIF into Pug template?

Viewed 45

I was trying to display a gif from Giphy to the webpage through pug. Here is my code: gif(src='https://giphy.com/embed/u458Fo50SS1K3kqVyK') It's not working. Anyone knows what the pug syntax should be?

2 Answers
  1. Instead of gif must be used the img(src="URL_TO_IMAGE")
  2. The https://giphy.com/embed/u458Fo50SS1K3kqVyK URL is not an image. It is the link to HTML site with image, but not URL to gif file. Your image URL must have valid image mime type.

Following example works:

img(src='https://www.w3.org/2008/site/images/logo-w3c-mobile-lg')

You can use image tag and src to url or save gif to images folder and provide path

<img src="url"/>
Related