将 Jekyll 添加到现有网站
Adding Jekyll to an existing website
我有一个简单的网站,并尝试在新文件夹 blog
中添加一个 Jekyll 博客,因此我在文件夹 /path
中有 运行 jekyll new blog
。但是,当我 运行 在 /path
中执行命令 jekyll build
时,我遇到了这些错误:
$ jekyll build
Configuration file: none
Source: /path
Destination: /path/_site
Generating...
Build Warning: Layout 'post' requested in blog/_posts/2015-06-14-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'default' requested in blog/index.html does not exist.
Conversion error: Jekyll::Converters::Scss encountered an error converting 'blog/css/main.scss'.
Conversion error: File to import not found or unreadable: /blog/_sass/base.scss. Load paths: on line 47
我通过在父文件夹中移动 _config.yml
解决了第一个问题 (Configuration file: none
),但是在使用
请求布局时我仍然遇到问题
---
layout: default
---
main.scss
中的导入也不起作用(最后一个错误)。
如果我在 /path/blog
再次移动 _config.yml
后执行相同的命令 jekyll build
,我没有错误。有人知道如何使用我的配置在父文件夹中执行 jekyll build
吗?我是否必须完全更改我的网站架构以在其中包含 Jekyll 博客?
你 config.yml
在 /path
和
source: /_jekyll
destination: /blog
baseurl: /blog
你的 jekyll 源代码在 /path/_jekyll
.
您生成的文件将在 /path/blog
。
准备部署!
我有一个简单的网站,并尝试在新文件夹 blog
中添加一个 Jekyll 博客,因此我在文件夹 /path
中有 运行 jekyll new blog
。但是,当我 运行 在 /path
中执行命令 jekyll build
时,我遇到了这些错误:
$ jekyll build
Configuration file: none
Source: /path
Destination: /path/_site
Generating...
Build Warning: Layout 'post' requested in blog/_posts/2015-06-14-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'default' requested in blog/index.html does not exist.
Conversion error: Jekyll::Converters::Scss encountered an error converting 'blog/css/main.scss'.
Conversion error: File to import not found or unreadable: /blog/_sass/base.scss. Load paths: on line 47
我通过在父文件夹中移动 _config.yml
解决了第一个问题 (Configuration file: none
),但是在使用
---
layout: default
---
main.scss
中的导入也不起作用(最后一个错误)。
如果我在 /path/blog
再次移动 _config.yml
后执行相同的命令 jekyll build
,我没有错误。有人知道如何使用我的配置在父文件夹中执行 jekyll build
吗?我是否必须完全更改我的网站架构以在其中包含 Jekyll 博客?
你 config.yml
在 /path
和
source: /_jekyll
destination: /blog
baseurl: /blog
你的 jekyll 源代码在 /path/_jekyll
.
您生成的文件将在 /path/blog
。
准备部署!