我想用thinkbot的波旁威士忌制作我的octopress博客模板。整齐。我从头开始找不到任何涵盖octopress(或其root,jekyll)主题的文档。所以,我决定自定义octopress默认主题。
我已将相关的宝石添加到Gemfile
中,如:
gem 'compass', '~> 1.0.0.rc.1' # to make compass work with sass 3.3
gem 'sass', '~> 3.3' # unnecessary but better to be placed hier
gem 'bourbon'
gem 'refills'
gem 'neat'
gem 'bitters'
然后,我在.themes
路径下复制了默认主题,如:
ls .themes/classic .themes/bourtlen # so, new theme name is bourtlen :)
我在sass
下的bourtlen
文件夹为空。然后在sass
内,我跑了:
bourbon install
所有波旁王朝资产现在都在sass
之下。然后,我在screen.scss
下添加了sass
:
@import 'compass';
@import 'bourbon/bourbon';
@import 'base/base';
@import 'neat/neat';
@import 'custom/custom'; # for customization, it's also created in sass folder as _custom.scss
毕竟,我已经安装了我的新生儿主题,但当我点击命令生成该网站时,我收到了这些警告&错误:
❯ bin/rake generate --trace
** Invoke generate (first_time)
** Execute generate
## Generating Site with Jekyll
/home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `require': cannot load such file -- sass/script/node (LoadError)
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `require'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `require'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass.rb:5:in `require'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `each'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/bin/compass:20:in `require'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
from /home/ekrem/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
from /home/ekrem/.rbenv/versions/2.1.1/bin/compass:23:in `load'
from /home/ekrem/.rbenv/versions/2.1.1/bin/compass:23:in `<main>'
Notice: for 10x faster LSI support, please install http://rb-gsl.rubyforge.org/
Configuration file: /home/ekrem/ws-rails/blog-new/_config.yml
Source: source
Destination: public
Generating...
Build Warning: Layout 'nil' requested in blog/categories/ruby/atom.xml does not exist.
Build Warning: Layout 'nil' requested in blog/categories/rails/atom.xml does not exist.
Build Warning: Layout 'nil' requested in blog/categories/ember/atom.xml does not exist.
Build Warning: Layout 'nil' requested in atom.xml does not exist.
Build Warning: Layout 'nil' requested in robots.txt does not exist.
Build Warning: Layout 'nil' requested in blog/categories/ruby/atom.xml does not exist.
Build Warning: Layout 'nil' requested in blog/categories/rails/atom.xml does not exist.
Build Warning: Layout 'nil' requested in blog/categories/ember/atom.xml does not exist.
done.
网站毕竟在本地运行,但没有影响,因为(可能)这些错误&amp;警告。我想知道遗失了什么。
答案 0 :(得分:2)
我正在努力做同样的事情(使用Bourbon和Neat设置我的自定义Octopress主题),我设法解决了您遇到的同样问题。
自版本2.2以来detailed here,Jekyll在布局验证方面存在问题,因此您需要手动将nil
更改为null
2个文件:
这将解决杰基尔,它将停止翘起:)
当我尝试升级Compass时,我有一个噩梦,所以可以安装Bourbon。似乎Compass被锁定到旧版本的SASS,该版本被锁定为旧版本的listen,无法更新......
我最终必须删除我安装的所有Compass版本,然后安装版本1.0.1。
在我的情况下,另一个问题是我在全局安装了宝石,而不是每个项目,所以我必须添加一个.bundle/config
文件来告诉Bundler
克隆Octopress仓库的宝石的位置
---
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'
执行这些更改后,Octopress应该乐意与Bourbon合作。
我希望它有所帮助。
答案 1 :(得分:0)
对于&#39; nil&#39;警告:
创建一个空的&#34; nil.html&#34; _layouts文件夹中的文件
(Jekyll开始验证布局......)