SCSS 的 Nanoc 过滤器
Nanoc filter for SCSS
我正在使用 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
我找到了一个名为 Compass 的实用程序,它为您提供了 SCSS 的过滤器选项。
使用 SASS 过滤器,如 How can I get the nanoc SASS filter to use SCSS syntax?
中所述
filter :sass, syntax: :scss
我正在使用 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
我找到了一个名为 Compass 的实用程序,它为您提供了 SCSS 的过滤器选项。
使用 SASS 过滤器,如 How can I get the nanoc SASS filter to use SCSS syntax?
中所述filter :sass, syntax: :scss