使用Jekyll使用Github页面推送网站后获取空白页面

问题描述 投票:6回答:2

我用Jekyll创建了一个GitHub Pages网站。浏览http://localhost:4000时一切都很好。

然后我将它推送到GitHub,但访问https://USERNAME.github.io/时没有任何内容(空白页面,没有错误,没有内容)。

Gemfile的内容,

source "https://rubygems.org"
ruby RUBY_VERSION

gem "minima", "~> 2.0"

gem "github-pages", group: :jekyll_plugins

group :jekyll_plugins do
   gem "jekyll-feed", "~> 0.6"
end

我的回购结构,(为什么没有上传_site?)

_posts        Initial commit for Jekyll             23 hours ago
.gitignore    Initial commit for Jekyll             23 hours ago
Gemfile       Uncomment some lines for GitHub Pages 23 hours ago
Gemfile.lock  Initial commit for Jekyll             23 hours ago
_config.yml   Initial commit for Jekyll             23 hours ago
about.md      Initial commit for Jekyll             23 hours ago
index.md      Initial commit for Jekyll             23 hours ago

我错过了一些步骤吗?

github jekyll github-pages
2个回答
1
投票

_site没有上传,因为它在你的.gitignore文件中。

"GitHub Pages manages your site's build process with a single push to your site's publishing branch"所以你不需要上传已建站点的文件。

从您想要的源文件夹验证您的站点是否正在构建。见these instructions


0
投票

当我尝试使用GitHub Pages不支持的theme时,我遇到了类似的问题。

然后我发现GitHub Pages支持自定义主题:https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/

例如在我的情况下,我想使用这个主题,这是一个宝石:https://github.com/mmistakes/minimal-mistakes

而不是改变theme中的_config我不得不添加remote_theme: remote_theme: mmistakes/minimal-mistakes

© www.soinside.com 2019 - 2024. All rights reserved.