【问题标题】:Adding Jekyll to an existing website将 Jekyll 添加到现有网站
【发布时间】:2015-06-14 18:59:13
【问题描述】:

我有一个简单的网站,并尝试在新文件夹 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 中的导入也不起作用(最后一个错误)。

如果我在再次移动_config.yml 后在/path/blog 中执行相同的命令jekyll build,我没有错误。有人知道如何使用我的配置在父文件夹中执行jekyll build吗?我是否必须完全改变我的网站架构才能在其中包含 Jekyll 博客?

【问题讨论】:

    标签: jekyll


    【解决方案1】:

    config.yml/path

    source: /_jekyll
    destination: /blog
    baseurl: /blog
    

    您的 jekyll 资源位于 /path/_jekyll

    您生成的文件将位于/path/blog

    准备部署!

    【讨论】:

    • 与源 _jekyll 和目标 blog 一起使用,不带斜线,感谢您的帮助!
    • 这最终工作了,但现在我的 _sass 文件夹坏了。我收到一个转换错误Jekyll::Converters::Scss encountered an error while converting 'style.scss': Error: File to import not found or unreadable: reset. on line 5:1 of style.scss >> @import "reset"; ^ 这是在我将blog\_sass 添加到sass_dir 之后有什么建议吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-13
    • 1970-01-01
    相关资源
    最近更新 更多