Get a blank page after pushing a site using Github pages with Jekyll

老子叫甜甜 提交于 2020-08-02 08:04:10

问题


I created a GitHub Pages site with Jekyll. Everything is fine when browsing to http://localhost:4000.

Then I pushed it to GitHub, but there is nothing (blank page, no error, no content) when accessing https://USERNAME.github.io/.

The content of 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

The structure of my repo, (why is _site not uploaded?)

_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

Do I miss some steps?


回答1:


_site was not uploaded because it is in your .gitignore file.

"GitHub Pages manages your site's build process with a single push to your site's publishing branch" so you do not need to upload the files of a built site.

Verify your site is being built from the source folder you intend. See these instructions.




回答2:


I had similar problem when I've tried to use theme which is not supported by GitHub Pages.

Then I've found out that GitHub Pages support custom themes: https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/

For example in my case I wanted to use this theme which is in a gem: https://github.com/mmistakes/minimal-mistakes

And instead of changing theme in _config I had to add remote_theme: remote_theme: mmistakes/minimal-mistakes



来源:https://stackoverflow.com/questions/39933404/get-a-blank-page-after-pushing-a-site-using-github-pages-with-jekyll

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