使用 Tilt 和 Compass 渲染 Sass 模板

发布于 2024-12-11 09:33:16 字数 471 浏览 5 评论 0原文

我正在开发一个静态站点生成器(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

茶底世界 2024-12-18 09:33:16

我想通了。 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 to Tilt.new.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文