摘要
-
我想在Jekyll使用
gem "jekyll-remote-theme"
看到本地机器中的页面 -
所以我跑了
bundle exec jekyll serve
-
但是出现了一个空白页面
我想要实现的目标
- 使用
gem "jekyll-remote-theme"
查看Jekyll制作的本地计算机中的页面 .
我正在尝试使用Jekyll和Minimal Mistakes在GitHub页面中构建一个博客 . 在我推动更改之前,我想检查页面是否一切正常 .
环境
-
Windows 8.1 64位
-
ruby 2.4.3p205(2017-12-14修订版61247)[x64-mingw32]
-
Jekyll 3.6.2
我做了什么
-
bundle exec jekyll new . --force
-
用GitHub Pages Method安装主题
-
bundle exec jekyll serve
究竟发生了什么
我有一个与 libcurl.dll
相关的错误 . 以下是Powershell上的消息 .
依赖性错误:哎呀!看起来您没有安装jekyll-remote-theme或其依赖项 . 为了使用当前配置的Jekyll,您需要安装此gem . 来自Ruby的完整错误消息是:'无法打开库'libcurl':(非法字符) . 无法打开libr ary'libcurl.dll':(非法字符) . 无法打开库'lib curl.so.4':(非法字符) . 无法打开库'libcurl.so .4.dll':(非法字符)'如果遇到麻烦,可以在https://jekyllrb.com/help/找到有用的资源!
我按照GitHub Pages Dependencies Missing · Issue #17 · benbalter/jekyll-remote-theme中的说明进行操作,问题解决了 .
然后 bundle exec jekyll serve
出现了另一个错误 . 本地创建的页面为空白 . http://127.0.0.1:4000/什么也没说 .
PS E:\workspace\mysite\dixhom.github.io> bundle exec jekyll serve
Configuration file: E:/workspace/mysite/dixhom.github.io/_config.yml
Source: E:/workspace/mysite/dixhom.github.io
Destination: E:/workspace/mysite/dixhom.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Remote Theme: Using theme mmistakes/minimal-mistakes
Build Warning: Layout 'single' requested in _posts/2018-02-06-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'default' requested in 404.html does not exist.
Build Warning: Layout 'page' requested in about.md.bak does not exist.
Build Warning: Layout 'home' requested in index.html does not exist.
Build Warning: Layout 'home' requested in index.md.bak does not exist.
done in 5.423 seconds.
Auto-regeneration: enabled for 'E:/workspace/mysite/dixhom.github.io'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
看起来 jekyll
无法读取布局文件 . 另外, _layouts
目录不在我做的目录 bundle exec jekyll new
中 . 但默认情况下,what's in the _layouts directory is packaged in a theme所以通常不看目录 . 所以我只是将 _layouts
从minimal-mistakes GitHub repo复制到本地目录作为解决方法 .
然后,又出现了另一个错误 .
PS E:\workspace\mysite\dixhom.github.io> bundle exec jekyll serve
Configuration file: E:/workspace/mysite/dixhom.github.io/_config.yml
Source: E:/workspace/mysite/dixhom.github.io
Destination: E:/workspace/mysite/dixhom.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Remote Theme: Using theme mmistakes/minimal-mistakes
Liquid Exception: Could not locate the included file 'sidebar.html' in any of ["E:/workspace/mysite/dixhom.github.io/_
includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site sourc
e. in /_layouts/single.html
jekyll 3.6.2 | Error: Could not locate the included file 'sidebar.html' in any of ["E:/workspace/mysite/dixhom.github.i
o/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site so
urce.
我本可以用同样的方式复制 _includes
但我相信问题的核心在于 jekyll failing to read necessary files from, for example, a GitHub repo .
奇怪的是当我将本地更改推送到GitHub时,GitHub Pages显示正确呈现的页面,如下所示 .
顺便说一句,回购是https://github.com/Dixhom/dixhom.github.io/tree/7132905f5515345eb78cd71bdad168a15f906a1c
我怀疑 jekyll-remote-theme
并没有帮助 .
谷歌搜索关键字,如“远程主题生成警告:布局不存在” . 没多大帮助 .
-
jekyll - Github Pages renders blank page - Stack Overflow
不同 . 在本地机器上工作而不是在github页面上 -
Jekyll on github doesn't works the same as local jekyll server - Stack Overflow
相同 . -
Jekyll works locally but comes up blank on github pages - Help - Jekyll Talk
-相同 . -
Blank new blog generated with Jekyll-3.2.1 on Windows · Issue #5192 · jekyll/jekyll
它似乎一见钟情,但它是关于 Gem based themes ,而不是偏远的主题 .
我怎么解决这个问题?
1 回答
aaaah我也只是反对这一点 . 我跑了
bundle exec jekyll serve --verbose
,看到jekyll-remote-theme
从未被初始化(每个插件记录一个Requiring: jekyll-<thing>
行) . 然后我注意到Gemfile中的这个块:我将
"gem jekyll-remote-theme"
添加到该插件块并修复了它 - doh!关于这个Gemfile组的jekyll changelogs中有一些注释,但我没有发现任何一个超级有助于解释这里发生了什么 .
希望有所帮助!