Github Pages根使用Jekyll给出404 [英] Github Pages root gives 404 with Jekyll

查看:281
本文介绍了Github Pages根使用Jekyll给出404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我的Jekyll网站发布到了Github页面.我正在使用映射到我的username.github.io帐户的自定义域(example.com).

I've recently published my Jekyll site to Github pages. I'm using my custom domain (example.com) that's mapped to my username.github.io account.

如果我转到example.com/index或example.com/index.html,则我的网站可以正常工作.

If I go to example.com/index or example.com/index.html, my site works.

但是,如果我只是去example.com,我会得到一个样式为404页面的GitHub页面.

However, if I just go to example.com I get a GitHub pages styled 404 page.

我尝试在Jekyll根目录DIR中包含一个index.html文件.我还尝试过用index.md替换掉它,它的前题中有layout:home,它在我的_layouts文件夹中调用了home布局.

I've tried having an index.html file in my Jekyll root DIR. I've also tried replacing that with an index.md that has layout:home in the frontmatter, which calls a home layout in my _layouts folder.

有人知道我如何获得此信息,以便example.com在首页上显示内容吗?

Does anyone know how I can get this so example.com shows content on the homepage?

推荐答案

对我来说,创建一个名为index.htm的附加索引文件(不带尾随的"l")似乎可以解决该问题.奇怪的是,创建index.htm之后,是GitHub Pages呈现的是index.html;我通过使index.htm和index.html稍有不同来验证了这一点.

For me, creating an additional index file named index.htm (without the trailing 'l') seemed to solve the issue. Oddly, after creating index.htm, it was index.html that was rendered by GitHub Pages; I verified that by making index.htm and index.html slightly different.

这篇关于Github Pages根使用Jekyll给出404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆