Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...