App icon in header at Privacy Policy page won't load
AdilSoomro opened this issue ยท 3 comments
I've provided custom app icon in config.yml, which loads fine on homepage. However it won't load at privacy policy page and when looking at the imgsrc link its looking in wrong directory ie domain.com/privacypolicy/assets/appicon.png
For example have a look at:
- Home Page: imagitor.booleanbites.com
- Privacy Policy Page: privacypolicy
I managed to fix it by editing header.html file.
from this:
{% if page.url != '/' %} <a href="../" target="_self"><img class="headerIcon" src="{{ site.app_icon }}"></a> {% else %} <img class="headerIcon" src="{{ site.app_icon }}"> {% endif %}
to this :
{% if page.url != '/' %} <a href="../index.html" target="_self"><img class="headerIcon" src="../assets/appicon.png"></a> {% else %} <img class="headerIcon" src="{{ site.app_icon }}"> {% endif %}
hope it helps! ๐๐ป
This has been sitting here for a little while, but in case anyone out there runs into this: you've probably just got relative file paths in your config.yml instead of absolute paths. Instead of this...
app_icon: assets/appicon.png
do this:
app_icon: /assets/appicon.png
Same goes for other resources that are accessible from multiple pages, like your press kit ๐
Did something change to where this isn't working as of late? I recently loaded this template and am trying to add images to presskit.md and other pages using
![](/assets/image.png)
It shows fine in the "Preview" pane on Github, but after publishing, the images don't show up. I have older sites deployed from this template that use this exact method that work fine.
Thanks!