首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于SCSS的Nanoc滤波器

用于SCSS的Nanoc滤波器
EN

Stack Overflow用户
提问于 2016-08-31 19:32:50
回答 2查看 125关注 0票数 1

我正在写一个网站使用nanoc和ruby,我想使用SCSS。但我有点小问题。无论我怎么尝试,我都不能让我的SCSS文件转换并输出为编译后的CSS。它要么抛出错误,要么作为完全相同的文件类型出现。我的Ruby规则文件和目录结构如下,请帮助!

代码语言:javascript
复制
#!/usr/bin/env ruby

compile '/**/*.html' do
  layout '/default.*'
end

# This is an example rule that matches Markdown (.md) files, and filters them
# using the :kramdown filter. It is commented out by default, because kramdown
# is not bundled with Nanoc or Ruby.
#
#compile '/**/*.md' do
#  filter :kramdown
#  layout '/default.*'
#end

route '/**/*.{html,md}' do
  if item.identifier =~ '/index.*'
    '/index.html'
  else
    item.identifier.without_ext + '/index.html'
  end
end

compile '/assets/SCSS/' do
  filter :scss => :css
  write @item.identifier.without_ext + '.css'
 end

compile '/assets/images/*' do
  write item.identifier.to_s
end

compile '/**/*' do
  write item.identifier.to_s
end

layout '/**/*', :erb

下面是我的目录结构:

代码语言:javascript
复制
root
|
|\_content
|  |
|   \_assets
|     |
|      \_test.scss
\_public
  |
   \_assets
     |
      \_test.scss <-------- This should be compiled CSS
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-09-01 20:49:31

我发现了一个名为Compass的实用程序,它为您提供了SCSS的过滤选项。

票数 1
EN

Stack Overflow用户

发布于 2018-05-28 20:58:13

使用How can I get the nanoc SASS filter to use SCSS syntax?中概述的SASS滤波器

代码语言:javascript
复制
filter :sass, syntax: :scss
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39248490

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档