简体   繁体   English

Github页面:页面构建失败

[英]Github Pages: Page build failed

I'm constantly getting the following error messages from github when I try to push my Jekyll site to their pages. 当我尝试将我的Jekyll网站推送到他们的页面时,我不断从github得到以下错误消息。

The page build failed with the following error: 页面构建失败,出现以下错误:

Page build failed. 页面构建失败。 For more information, see https://help.github.com/articles/troubleshooting-github-pages-build-failures . 有关更多信息,请参见https://help.github.com/articles/troubleshooting-github-pages-build-failures

If you have any questions please contact us at https://github.com/contact . 如果您有任何疑问,请通过https://github.com/contact与我们联系。

I ran jekyll serve to see if anything suspicious is going on, but the only thing it gives me is a warning: Build Warning: Layout 'default' requested in app/index.html does not exist. 我运行jekyll serve来查看是否发生了可疑事件,但是它给我的唯一警告是: Build Warning: Layout 'default' requested in app/index.html does not exist.

Am I missing something? 我想念什么吗? All my files are on Github: https://github.com/BobWassermann/confguide 我所有的文件都在Github上: https : //github.com/BobWassermann/confguide

Github pages is looking for your files at the root of your repository, then as it doesn't find _layouts and so on, at the right place, the build fails. Github页面正在存储库的根目录中查找文件,然后由于找不到_layouts等,因此在正确的位置构建失败。

To avoid this, in config.yml add source: app . 为了避免这种情况,请在config.yml添加source: app

Note: As your repository will be served at https://github.com/BobWassermann/confguide , all links to your assets will fail. 注意:由于您的存储库将在https://github.com/BobWassermann/confguide ,因此所有指向您资产的链接都将失败。

To avoid this, in config.yml add baseurl: /confguide . 为了避免这种情况,请在config.yml添加baseurl: /confguide

And in default.html call your assets with {{site.baseurl}} like this : default.html使用{{site.baseurl}}调用您的资产,如下所示:

<link rel="stylesheet" href="{{site.baseurl}}css/syntax.css">

and same for other assets (css/js/img). 与其他资产(css / js / img)相同。

Tried everything above, but nothing helped. 尝试了以上所有内容,但没有任何帮助。 Went trough everything and found the bug. 仔细检查了所有内容并发现了错误。 Github does not support a "_" folder in your images directory, even if it's in your copy task in Gruntfile. 即使在Gruntfile中的复制任务中,Github也不在您的图像目录中支持“ _”文件夹。

Removing my "_posts" folder in the img folder solved this issue. 删除img文件夹中的“ _posts”文件夹可解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM