Github Pages build failure

蹲街弑〆低调 提交于 2019-12-24 06:50:13

问题


I'm getting the following error about my Jekyll Github Pages reop: Your site is having problems building: A file was included in source/blog/index.html that is a symlink or does not exist in your _includes directory.

This is the file it is complaining about, and the rest of the code is contained in that repo. I'm confused because the two files it is referencing are in the _includes folder, so what could be the issue? The page works fine when I build and run it locally.

Thanks!


回答1:


I experienced the same problem, same error message, you probably got a post from github stating there is a symlink error, in my case I got this one:

The symbolic link /vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/ext/ffi_c/libffi-x86_64-linux-gnu/include/ffitarget.h targets a file which does not exist within your site's repository.

I do not know why this error occurs but I do know a workaround that probably works for you too.

Solution is build your site locally and only shoot _site folder to github.

Follow these steps:

  1. make a copy of your website folder (this one is your back-up, because your original folder will be reduced to only one folder, yes you guessed right the _site folder
  2. in your terminal switch to your original folder and run:jekyll build --safe
  3. now delete all folders in the directory except the _site folder
  4. actually we only want the content of _site folder -> you probably know how to get rid off the folder
  5. now it is time to shoot the content to github gh-pages, I assume you already have a github repo.
  6. type again in your terminal: git add ., git commit -m "static build", git push origin gh-pages
  7. enjoy your jekyll website hosted on github pages!


来源:https://stackoverflow.com/questions/44401664/github-pages-build-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!