【问题标题】:Error with SCSS generation in Jekyll 2.0Jekyll 2.0 中的 SCSS 生成错误
【发布时间】:2014-05-11 04:24:41
【问题描述】:

我的项目布局如下:

-Project
  -css
    -import.scss
    -_sass/
      main.scss

import.scss的内容是:

---
---

@import "main.scss";

我希望将 main.scss 导入到 import.scss 中,然后 import.scss 将编译为生成的 _site/ 目录中的 import.css。

相反,我收到以下错误

Conversion error: There was an error converting 'css/import.scss'.
jekyll 2.0.3 | Error:  Invalid CSS after "-": expected number or function, was "--"

我猜它是在抱怨 import.scss 顶部的 YAML front-matter,但我不确定解决方案是什么。

【问题讨论】:

    标签: ruby sass jekyll static-site


    【解决方案1】:

    我遇到了同样的错误,但这是我的解决方法:在 /css/*.scss 文件(例如您的 import.scss)上only 使用“---”YAML 前端,但不是部分。

    错误似乎是指部分 (/_scss) 文件中的前端问题。一旦我把它拿出来,Sass 又开始编译了。

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-26
      • 1970-01-01
      • 1970-01-01
      • 2021-12-11
      • 1970-01-01
      • 1970-01-01
      • 2015-09-20
      • 1970-01-01
      相关资源
      最近更新 更多