1
nanocとrubyを使用してサイトを作成しています。SCSSを使いたいと思います。しかし、私は少し問題があります。私が試しても、SCSSファイルを変換してコンパイル済みのCSSとして出力することはできません。エラーをスローするか、まったく同じファイルタイプとして出力されます。私のRubyのルールファイルとディレクトリ構造は以下のとおりです。ここでSCSSのNanocフィルタ
#!/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