rod*_*ner 4 themes rubygems jekyll
我已经使用Jekyll v3.4.3成功创建了我的第一个静态网站。现在,我想将默认的“ minima”主题更改为另一个基于gem的主题,例如jekyll-theme-minimal
据我了解,根据jekyll文档,这仅需要执行以下步骤:
1.-将主题添加到站点的Gemfile中:
gem "jekyll-theme-minimal", "~> 0.0.3"
Run Code Online (Sandbox Code Playgroud)
2.-安装主题:
bundle install
Run Code Online (Sandbox Code Playgroud)
3.-将以下内容添加到站点的_config.yml中以激活主题(注释“ minima”并添加新的主题):
theme: jekyll-theme-minimal
Run Code Online (Sandbox Code Playgroud)
4.-建立您的网站:
bundle exec jekyll serve
Run Code Online (Sandbox Code Playgroud)
我遵循了这些步骤,但是构建站点(步骤4)带来以下错误:
$ bundle exec jekyll serve
Configuration file: /home/username/jekyll/myblog/_config.yml
Configuration file: /home/username/jekyll/myblog/_config.yml
Source: /home/username/jekyll/myblog
Destination: /home/username/jekyll/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Build Warning: Layout 'post' requested in _posts/2017-03-22-welcome-to-jekyll.markdown does not exist.
Liquid Exception: Could not locate the included file 'icon-github.html' in any of ["/home/username/jekyll/myblog/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source. in about.md
Run Code Online (Sandbox Code Playgroud)
我看到已经安装了新的基于gem的主题
$ bundle show jekyll-theme-minimal
/home/username/.gem/ruby/2.4.0/gems/jekyll-theme-minimal-0.0.3
Run Code Online (Sandbox Code Playgroud)
但是我注意到新主题没有_includes目录。另外,我发现Jekyll网站目录中的about.md文件仍在引用默认的“ minima”主题:
$ cat ~/jekyll/myblog/about.md
---
layout: page
title: About
permalink: /about/
---
This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/)
You can find the source code for the Jekyll new theme at:
{% include icon-github.html username="jekyll" %} /
[minima](https://github.com/jekyll/minima)
You can find the source code for Jekyll at
{% include icon-github.html username="jekyll" %} /
[jekyll](https://github.com/jekyll/jekyll)
Run Code Online (Sandbox Code Playgroud)
如何在我的站点中将默认的“ minima”主题更改为另一个基于gem的主题?
Jekyll主题文档指定了使用新主题的一般步骤,但是由于Jekyll 非常灵活,因此无法保证每个主题都可以立即使用。
Jekyll默认安装,附带示例数据,页面布局并包括。
最小主题具有默认布局,并且不包含include,因为Jekyll附带的示例帖子使用include并使用页面布局,因此无法使用。
安装最小主题之后,您需要确保所有帖子都具有布局:默认为其布局(无布局:页面或任何其他页面),且帖子内容不包含。
在这种情况下,经过about.md类似的调整后,将如下所示:
---
layout: default
title: About
permalink: /about/
---
This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/)
You can find the source code for the Jekyll new theme at:
[minima](https://github.com/jekyll/minima)
You can find the source code for Jekyll at
[jekyll](https://github.com/jekyll/jekyll)
Run Code Online (Sandbox Code Playgroud)
或者,如果您不想更改帖子的内容,只需提供缺少的包含和/或布局即可创建这些文件夹,并使用新主题创建您希望拥有的适当的丢失文件,而不仅限于使用主题使用的内容覆盖主题默认值
| 归档时间: |
|
| 查看次数: |
927 次 |
| 最近记录: |