如何使用 jekyll 的本地插件?
How to use local plugins for jekyll?
我的 jekyll 站点托管在服务器上,我只是上传 _site
文件夹。
一切正常。
不过,我想添加本地插件。当我将文件添加到我的 new _plugins
文件夹时,它们被忽略并且我收到新声明标签的 Liquid syntax error (line 7): Unknown tag ...
错误。
根据我在此处和 jekyll.rb 站点上阅读的内容,问题可能是我的 Gemfile 中有一个 github-pages
gem。
Gemfile
source 'https://rubygems.org'
group :jekyll_plugins do
gem 'github-pages'
gem 'jekyll'
gem 'jekyll-paginate'
gem 'jekyll-scholar'
gem 'jemoji'
end
但是,如果我删除 gem 'github-pages'
行,我会得到这个错误:
Dependency Error: Yikes! It looks like you don't have pygments or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- pygments' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
如果我安装pygments,还是会出现同样的错误,但是显示安装成功
$ gem install pygments.rb [8:05:33]
Fetching: pygments.rb-1.2.1.gem (100%)
Successfully installed pygments.rb-1.2.1
Parsing documentation for pygments.rb-1.2.1
Installing ri documentation for pygments.rb-1.2.1
Done installing documentation for pygments.rb after 0 seconds
1 gem installed
我该怎么做才能使用我的本地插件? (我真的只是希望能够嵌入本地视频,所以我为此添加了一个插件)
您收到该错误是因为您尚未将 pygments.rb
添加到您的 Gemfile
只需将它添加到 Gemfile
,此错误就会消失。
# Gemfile
gem 'jekyll'
gem 'pygments.rb'
group :jekyll_plugins do
gem 'jekyll-paginate'
gem 'jekyll-scholar'
gem 'jemoji'
end
我的 jekyll 站点托管在服务器上,我只是上传 _site
文件夹。
一切正常。
不过,我想添加本地插件。当我将文件添加到我的 new _plugins
文件夹时,它们被忽略并且我收到新声明标签的 Liquid syntax error (line 7): Unknown tag ...
错误。
根据我在此处和 jekyll.rb 站点上阅读的内容,问题可能是我的 Gemfile 中有一个 github-pages
gem。
Gemfile
source 'https://rubygems.org'
group :jekyll_plugins do
gem 'github-pages'
gem 'jekyll'
gem 'jekyll-paginate'
gem 'jekyll-scholar'
gem 'jemoji'
end
但是,如果我删除 gem 'github-pages'
行,我会得到这个错误:
Dependency Error: Yikes! It looks like you don't have pygments or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- pygments' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
如果我安装pygments,还是会出现同样的错误,但是显示安装成功
$ gem install pygments.rb [8:05:33]
Fetching: pygments.rb-1.2.1.gem (100%)
Successfully installed pygments.rb-1.2.1
Parsing documentation for pygments.rb-1.2.1
Installing ri documentation for pygments.rb-1.2.1
Done installing documentation for pygments.rb after 0 seconds
1 gem installed
我该怎么做才能使用我的本地插件? (我真的只是希望能够嵌入本地视频,所以我为此添加了一个插件)
您收到该错误是因为您尚未将 pygments.rb
添加到您的 Gemfile
只需将它添加到 Gemfile
,此错误就会消失。
# Gemfile
gem 'jekyll'
gem 'pygments.rb'
group :jekyll_plugins do
gem 'jekyll-paginate'
gem 'jekyll-scholar'
gem 'jemoji'
end