将Jekyll添加到现有网站 [英] Adding Jekyll to an existing website
问题描述
我有一个简单的网站,并试图在其中添加一个Jekyll博客到一个新文件夹blog
中,因此我已经在文件夹/path
中运行了jekyll new blog
.但是,当我在/path
中运行命令jekyll build
时,出现以下错误:
I have a simple website and tried to add a Jekyll blog in it in a new folder blog
thus I have run jekyll new blog
in the folder /path
. However when I'm running the command jekyll build
in /path
I have these errors:
$ 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
),但是使用
I solved the first problem (Configuration file: none
) by moving _config.yml
in the parent folder, however I still have problems when requesting layout using
---
layout: default
---
main.scss
中的导入也不起作用(最后一个错误).
The imports in main.scss
are also not working (last error).
如果再次移动_config.yml
之后在/path/blog
中执行相同的命令jekyll build
,则没有错误.有人知道如何使用我的配置在父文件夹中执行jekyll build
吗?我是否必须完全更改网站的架构以在其中包含一个Jekyll博客?
If I'm doing the same command jekyll build
in /path/blog
after moving again _config.yml
, I have no errors. Does someone know how to be able to do a jekyll build
in the parent folder with the configuration I have? Do I have to entirely change the architecture of my website to include a Jekyll blog in it?
推荐答案
您config.yml
和
source: /_jekyll
destination: /blog
baseurl: /blog
您的jekyll来源位于/path/_jekyll
.
Your jekyll sources are in /path/_jekyll
.
您生成的文件将位于/path/blog
中.
And you generated files will be in /path/blog
.
准备部署!
这篇关于将Jekyll添加到现有网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!