【问题标题】:Nanoc filter for SCSS用于 SCSS 的 Nanoc 过滤器
【发布时间】:2016-08-31 11:32:50
【问题描述】:

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

#!/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

这是我的目录结构:

root
|
|\_content
|  |
|   \_assets
|     |
|      \_test.scss
\_public
  |
   \_assets
     |
      \_test.scss <-------- This should be compiled CSS

【问题讨论】:

    标签: css ruby nanoc


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      filter :sass, syntax: :scss
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-12-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多