我用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
我错过了一些步骤吗?
_site
没有上传,因为它在你的.gitignore文件中。
"GitHub Pages manages your site's build process with a single push to your site's publishing branch"所以你不需要上传已建站点的文件。
从您想要的源文件夹验证您的站点是否正在构建。见these instructions。
当我尝试使用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