I’m trying to create my own website and I’m using Nanoc. I’m also writing my files in HAML and SASS.
When I’m writing into my SASS file, I always have the error
Haml::SyntaxError: Illegal nesting: nesting within plain text is illegal
when I compile (nanoc compile
).
My sass files are in /content/css
and I would like they go in /output/css
The thing I don’t understand is that if I put spaces or if I put a tab, it doesn’t compile. The only thing which works is when I don’t put any spaces or tabs. It compiles but the CSS in output doesn’t work.
I looked here before : https://groups.google.com/forum/#!topic/nanoc/UI4VccZCDD4 but it doesn't correct my compilation error.
I let my style.sass
file and my Rules
file below.
What is causing this issue and how can I resolve it?
div.title
width: 80%
background-color: #b7b8b2
If I put no spaces before width
and background
, it compiles but doesn't work.
#!/usr/bin/env ruby
require 'compass'
Compass.add_project_configuration 'config.rb' # when using Compass 0.10
### Compile rules
compile '/content/css/*' do
filter :sass, Compass.sass_engine_options # add the second parameter for Compass
end
compile '*' do
if item.binary?
# don’t filter binary items
else
filter :haml
layout 'default'
end
end
### Route rules
route '/content/css/*' do
#'/style.css'
# item.identifier.chop + '.css' #so that the /content/stylesheet.sass item is compiled in sass
unless item.identifier.start_with?('/content/css/_') # for partials
item.identifier.gsub(/\/$/, '') + '.css'
end
end
route '*' do
if item.binary?
# Write item with identifier /foo/ to /foo.ext
item.identifier.chop + '.' + item[:extension]
else
# Write item with identifier /foo/ to /foo/index.html
item.identifier + 'index.html'
end
end
### Layout rules
layout '*', :haml