Header Image Path #417
-
Bug ReportEnvironmentGentoo linux Expected BehaviorTell us what should have happened. I cannot get the header image to display. I placed it in static/img, and set the path as img/image.png in my _index.md in content, but it still does not display. When visiting localhost:1111/img/image.png, it does display, but currently there is nothing except the img_alt text. The only way I can get it to display is by specifying it in home_banner.html |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 13 replies
-
Hello! Can you share the exact content of the Have you checked the network monitor (Firefox docs) to see what happens when it attempts to load the file? Did you try to find the image in the I would try to replicate the demo first:
+++
title = "Latest posts"
sort_by = "date"
template = "section.html"
[extra]
header = {title = "title", img = "img/main.webp", img_alt = "alt" }
+++ |
Beta Was this translation helpful? Give feedback.
-
I will try those suggestions, thank you. The demo image does not work.
The image does show up in the public directory In network monitor, it shows up as 'blocked.' |
Beta Was this translation helpful? Give feedback.
-
I changed the first line in content-security-policy.html to How should I configure to allow for the image source, but in a more secure way? The image is in static/img in the root dir. |
Beta Was this translation helpful? Give feedback.
-
That's helpful! You mentioned you visit a localhost URL. Is that the URL Zola provides when you run For me, it's Try removing the CSP and visiting the URL Zola returns upon |
Beta Was this translation helpful? Give feedback.
-
That worked, thanks! |
Beta Was this translation helpful? Give feedback.
-
Happy to hear! |
Beta Was this translation helpful? Give feedback.
-
Greetings, I was hoping that you could refer me to documentation on how to add images to blog posts, unless it is not something specific to this theme. |
Beta Was this translation helpful? Give feedback.
That's helpful!
You mentioned you visit a localhost URL. Is that the URL Zola provides when you run
zola serve
?For me, it's
http://127.0.0.1:1111
. I just tested going to localhost:1111 and it loads, but has issues (like the image not loading).Try removing the CSP and visiting the URL Zola returns upon
zola serve
. That should fix it!