使用 Tilt 和 Compass 渲染 Sass 模板
我正在开发一个静态站点生成器(Staticpress),它使用 Tilt 来处理渲染。 Tilt 开箱即用,可以很好地渲染 sass;然而,当我渲染一个尝试 @import compass/reset/utilities 的 sass 模板时,Sass 会引发一个 Sass::SyntaxError
。当我调用 #render
时,我可以向 Tilt 传递额外的选项(这将传递给 Sass),但是我应该传递哪些选项来使 Compass 可用?
更新:
我有一个单行测试文件,其中仅包含@import "compass/reset/utilities"
。运行测试时出现的错误是 Sass::SyntaxError: File to import not find or unreadable: compass/reset/utilities
以及堆栈跟踪。
I am working on a static site generator (Staticpress) that uses Tilt to handle rendering. Out of the box, Tilt can render sass just fine; however when I render a sass template that tries to @import compass/reset/utilities
, Sass raises a Sass::SyntaxError
. I can pass extra options to Tilt when I call #render
(which will be passed on to Sass), but what options should I pass to make Compass available?
Update:
I have a one-line test file that only has @import "compass/reset/utilities"
in it. The error I get when running my test is Sass::SyntaxError: File to import not found or unreadable: compass/reset/utilities
, along with a stack trace.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了。 Tilt 有一种将选项传递给渲染引擎的方法。要使用 Compass,请将
Compass.sass_engine_options
传递给Tilt.new
。I figured it out. Tilt has a way to pass options through to the rendering engine. To use Compass, pass
Compass.sass_engine_options
toTilt.new
.