No Favicon in Netlify after Two Redeploys

Hello!

I built my site using semantic HTML, CSS and JS using Eleventy. I bought my domain with NameCheap. In my local development, my favicon always shows. But I’ve already redeployed twice with Netlify and nothing.

I read the topics on this forum related to this issue. I’ve cleared my caches repeatedly, always test with Chrome, Safari, Brave, and Firefox. I initially created a subfolder in my ‘img’ folder for the favicons. Nothing. I tried placing the favicon in the root directory, nothing. I created a favicon folder in the root directory and nothing. This is my favicon code:[elenasosalerin.com/page-head.njk at master · esarin7/elenasosalerin.com · GitHub]

I used realfavicongenerator.net and it says that my favicon “is declared but not accessible.” I don’t know what else to do, I feel quite annoyed and defeated at this point.

I’m very new to development - eight months or so and Eleventy was definitely a learning curve and I’m disappointed at myself for not nailing what is technically an easy feature to implement. But what is driving me crazy is that in my local development, the favicon always shows.

Thanks in advance for any support on this!

Hi @e_sarin do you mind posting the link to your site as well? Also is there any build process that Netlify has to run?

I noticed in your netlify.toml your publish directory is _site but you also have _site in your repository. Normally, if you have a build process on Netlify (i.e. Netlify generates a new _site folder every time you push changes) and your publish directory is already a folder in your repo, Netlify deploys the existing folder you uploaded not the one it generated, leading to stale files being deployed.

Hi @simeon9696, thanks a lot for replying.

So, do you suggest I delete my _site from my repository? Or change my .toml file? I’m still trying to find my way around using Netlify and am unaware of its building processes.

This is the link to my site:
https://www.elenasosalerin.com

Thanks!

Apologies I’m not sure how I missed this. In your netlify.toml you did specify a build command command = "DEBUG=* eleventy" So every time you pushed changes to your repository, Netlify would run that command to build your site.

However, it outputs to _site and your repository already contains a _site folder. So what I think Netlify just keeps on deploying the stale files?

Here’s what you could try:
1.) Delete the _site folder from your local machine
2.) Add site to your .gitignore
3.) Commit the changes to your repo and push it to github
4.) Netlify should automatically trigger the rebuild so just wait.

The _site folder should not be in your repository after this and everything should be okay, if not let us know!

I tried your suggestions - no favicon yet. And also the site turned out naked - no CSS. :grimacing:

So… I decided to restore both, the _site folder to my local machine and the .toml file. And my site is still naked.

Should I choose a redeploy from earlier today to restore my site as it was?

Thanks for your help @simeon9696. I fixed my problem but can’t tell you exactly how it happened. I decided to redeploy my site using a version I had from earlier in the day. And voilà! Not only was the CSS back but – the favicon was there too!

Just to make sure, I made a few changes and added extra content to test if it was being written and everything seems to be working fine now. Ugh, technology! I spent so many hours trying to figure out such a minor feature.

Thanks for your thoughtful support.

1 Like