Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

why pug is not able to render images with links stored in mongoDB link

I am trying to display the book images with images stored on my computer and their links in mongoDB atlas. When all the books are being shown,none of the images are getting rendered while when I am viewing 1 book then the images are being shown. Also when I am hardcoding books link for any one image (for testing) then they are getting rendered.

I am using pug and here is my code

each book in book_list
             div(class="w3-quarter")
             
              a(href=book.url)
            
                img(src=book.imgpath, alt=book.title, height="180px", width="200px", class="dp")
                  
                p(id="title") Title:- #{book.title}
                p(id="author") Author:- #{book.author}

this is the result

and this is the code when selecting a specific book

 div(class="w3-container")     
            h1 #{title}: #{results.title}
            img(src=results.imgpath, alt="", height="250px", width="250px", class="dp")
question from:https://stackoverflow.com/questions/65884290/why-pug-is-not-able-to-render-images-with-links-stored-in-mongodb-link

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.6k users

...