将Jekyll添加到现有网站 [英] Adding Jekyll to an existing website

查看:58
本文介绍了将Jekyll添加到现有网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的网站,并试图在其中添加一个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.ymlin the parent folder, however I still have problems when requesting layout using

---
layout: default
---

main.scss中的导入也不起作用(最后一个错误).

The imports in main.scssare 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/blogafter moving again _config.yml, I have no errors. Does someone know how to be able to do a jekyll buildin 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆