My custom HTML for the Head is not displaying the image referenced in the img element. #1872
-
My custom HTML renders the header well on each page, except for the image. The element is set with src="/wp-content/uploads/oh-logo-round.png" and the wp-content page exists in the root directory (parallel to the input, output and preview directories). How come the image is not displayed in the preview? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I could be wrong, but I don't think that Publii can fetch images stored in folders outside of input... Your safest bet would be to host the image online (on something like Cloudinary, IMGUR, Backblaze), and link to that URL file. See parallel discussions: |
Beta Was this translation helpful? Give feedback.
-
for fonts I found this: https://getpublii.com/dev/dynamic-assets/ |
Beta Was this translation helpful? Give feedback.
-
Thanks for the direction. I wouldn't mind refactoring images site-wide if it was to a local directory such as assets. I tried putting it in /input/themes/assets but that it didn't work no matter how I tried linking to it. Linking off site does work so I'll mark this as solved, but I don't like the idea of having to using absolute links to assets. I tend to make self-contained websites with relative links for portability. But I'll save that for a feature request. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Thís problem seems to run a bit deeper. The links in my custom HTML also don't work. For example, the link to my About page is set with src="/about". When I preview the website it doesn't work and when I hover the mouse on the link it displays "file:///about". |
Beta Was this translation helpful? Give feedback.
I could be wrong, but I don't think that Publii can fetch images stored in folders outside of input...
Your safest bet would be to host the image online (on something like Cloudinary, IMGUR, Backblaze), and link to that URL file.
See parallel discussions: