Symlink Error with Adding Cookie Notice to Github Page

Hello! I’m trying to add a cookie notice to my site. I followed the directions exactly from Jekyll Codex

jekyllcodex.org/without-plugin/cookie-consent

I uploaded the file to the _includes folder on github, and added the needed code to the necessary layout page.

But I keep getting this error.

The page build failed for the master branch with the following error:

A file was included in /_layouts/base.html that is a symlink or does not exist in your _includes directory. For more information, see https://docs.github.com/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites#file-is-a-symlink.

The issue is, the required file is already in the _includes folder. I also copy and pasted the name of the file into the code of the layout file to make sure all the spelling is right. I’m not sure what I’m missing or why the cookie-consent.html file is not being seen in my _includes folder.

Any help will be appreciated!

Hi @arcadiapage, welcome to the GitHub Support Community!

Can you post a link to the repository you’re having trouble with? It’s a little hard to know what’s going on without being able to see it, so that’d be really helpful!

Here’s the link to my repository: https://github.com/arcadiapage/arcadiapage.github.io

I found a work around by going to a site that generates a cookie notice and then adding the code for that to the head.html file. But I’d rather see if I can get things working using the suggested method, so I removed that, and recreated the problem.

Thanks for your help!

Thanks for the link! It looks like this error is happening because the HTML template you’re including for your cookie consent banner has 2 includes of its own that don’t exist in your repository:

You’ll either need to add these templates to your repository or remove these includes before your site will build successfully.

Thank you! I removed the two includes from the HTML template, and now it works.