Compass and Nanoc

90 views
Skip to first unread message

Diego Santamarta

unread,
Sep 27, 2009, 8:44:50 PM9/27/09
to Compass
Hi to everybody, i was asking myself if anybody have tryed to work
together compass with nanoc. My ruby knowledge is very poor so i don't
know where to beguin with this integration, so if anybody have done it
would be great.

Thanks in advance.

Diego

msf

unread,
Sep 29, 2009, 4:07:42 AM9/29/09
to compas...@googlegroups.com

I have been using compass with a nanoc site. However, I don't even
try to integrate it with nanoc, I simply use a rake task to run
compass -u and copy the generated css files into the nanoc
output directory.

If anyone does come up with a way to use compass directly from within
nanoc, I would sure love to hear about it.

Dan Brendstrup

unread,
Sep 29, 2009, 12:06:44 PM9/29/09
to Compass
I'd love to know how to integrate the two as well.

The instructions for integrating with tools like StaticMatic and Webby
are very simple (and nearly identical), so perhaps something like that
would work?

http://wiki.github.com/chriseppstein/compass/staticmatic-integration
http://wiki.github.com/chriseppstein/compass/webby-integration

Since Nanoc loads everything in the lib-directory before compiling,
perhaps one could add a configuration.rb file with the following
contents:

require 'compass'

Compass.configuration do |config|
config.project_path = File.dirname(__FILE__)
config.sass_dir = File.join('content', 'assets', 'style' )
end


...or however the Sass source files are store in the content-
directory.

And the project_path would need to be the parent of the lib-directory,
but how does one do that?

Diego Santamarta

unread,
Sep 29, 2009, 12:35:01 PM9/29/09
to compas...@googlegroups.com
I spoke to Chris in a private mail and told me it would be very hard to do if you are a rails developer or you can have one for a couple of hours, but this is not my situatios, so let's try out other ways to see if we can figure out how can we solve this guys ;-)

2009/9/29 Dan Brendstrup <brend...@gmail.com>



--

Diego Santamarta
www.diegosantamarta.com

Chris Eppstein

unread,
Sep 29, 2009, 1:14:55 PM9/29/09
to compas...@googlegroups.com, compas...@googlegroups.com
I said it *wouldn't* be hard.

FYI the constant __FILE__ contains the filename of the file you are in. This can be used in conjunction with File.join and File.dirname to navigate your project. Eg:

File.join(File.dirname(__FILE__), '..')

Would be the path to the parent folder of your current file. 

Chris. 

Hunt & pecked on my iPhone... Sorry if it's brief!

Diego Santamarta

unread,
Sep 29, 2009, 1:49:02 PM9/29/09
to compas...@googlegroups.com
Sorry for the mistake i wanted to say that "it would't". :-)

2009/9/29 Chris Eppstein <ch...@eppsteins.net>



--

Diego Santamarta
www.diegosantamarta.com

Denis Defreyne

unread,
Oct 2, 2009, 8:36:42 AM10/2/09
to Compass
Hi,

This morning I took a stab at integrating nanoc and Compass, and it's
fairly easy. I've created a wiki page at <http://wiki.github.com/
chriseppstein/compass/nanoc-integration> which I'll reproduce here
(because it's rather short):

At the top of the Rules file, add the Compass configuration, like
this:

require 'compass'

Compass.configuration do |config|
config.project_path = File.dirname(__FILE__)
config.sass_dir = './content/assets/style'
end

(You may need to change the value of sass_dir depending on where your
Sass stylesheets are located.)

To filter the stylesheets using Sass and Compass, call the sass filter
with Sass engine options taken from Compass, like this:

filter :sass, Compass.sass_engine_options

I am not an experienced Compass user at all, though, so maybe this
approach isn't the best. Feedback is welcome. :)

Hope this helps,

Denis

Chris Eppstein

unread,
Oct 2, 2009, 12:20:46 PM10/2/09
to compas...@googlegroups.com, Compass
From the compass side, I would recommend that you have a compass
configuration file in one of the standard locations (see the compass
configuration wiki page) and that you read it within the nanoc file
seen here. There is an example of this strategy in my Sinatra example
application:

http://github.com/chriseppstein/compass-sinatra

Doing this will allow the app to interoperate with the compass
commandline tool.

Hunt & pecked on my iPhone... Sorry if it's brief!

On Oct 2, 2009, at 5:36 AM, Denis Defreyne

Adam Stacoviak

unread,
Oct 2, 2009, 1:15:44 PM10/2/09
to compas...@googlegroups.com
Wow. Nice response via iPhone. Or did you sneak and save as a draft and wrap up your reply at your desktop?

I'm glad you chimed in on this. I'm working on a Sinatra app at the moment (http://ask.changehealthcare.com/) that I'm updating to use Compass.

--
Adam Stacoviak | Handcrafted
m. 713-492-4598
http://twitter.com/adamstac
http://gethandcrafted.com

Chris Eppstein

unread,
Oct 2, 2009, 1:31:04 PM10/2/09
to compas...@googlegroups.com
Nope that was just on the iphone... sitting on the train. copy and paste ftw ;-)

Diego Santamarta

unread,
Oct 6, 2009, 7:40:15 AM10/6/09
to compas...@googlegroups.com
Hi Chris, I'm trying to understand what u mean with this answer but i dont really know. U mean this file?
http://github.com/chriseppstein/compass-sinatra/blob/master/config/compass.config



2009/10/2 Chris Eppstein <ch...@eppsteins.net>



--

Diego Santamarta
www.diegosantamarta.com

Charles Roper

unread,
Oct 6, 2009, 8:21:15 AM10/6/09
to compas...@googlegroups.com
On 06/10/2009 12:40, Diego Santamarta wrote:
> Hi Chris, I'm trying to understand what u mean with this answer but i
> dont really know. U mean this file?
> http://github.com/chriseppstein/compass-sinatra/blob/master/config/compass.config

Here's how I read it:

Instead of putting the config information directly into nanoc's Rules
file, it's better to parse an external config file. This means both the
Compass command line utility and nanoc are reading the same config. This
means you don't have to change your config in two places (staying DRY
and all that).

Chris, please correct me if I'm wrong on this.

Here's an example of my nanoc Rules file (my Compass config.rb file is
in <my_nanoc_project/compass/config.rb>):

#!/usr/bin/env ruby

require 'compass'
Compass.configuration.parse 'compass/config.rb'

compile '/assets/style/*/' do
filter :sass, Compass.sass_engine_options
end

route '/assets/style/*/' do
item.identifier.chop + '.css'
end

compile '*' do
filter :erb
layout 'default'
end

route '*' do
item.identifier + 'index.html'
end

layout '*', :erb

Charles Roper

unread,
Oct 6, 2009, 8:24:05 AM10/6/09
to compas...@googlegroups.com
On 06/10/2009 13:21, Charles Roper wrote:
> my Compass config.rb file

Forgot to post the content of my config.rb - it's really simple:

require 'susy'
# Require any additional compass plugins here.

project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "../output/stylesheets"
sass_dir = "src"
images_dir = "../output/images"
output_style = :compact
# To enable relative paths to assets via compass helper functions.
Uncomment:
# relative_assets = true

Diego Santamarta

unread,
Oct 6, 2009, 9:24:28 AM10/6/09
to compas...@googlegroups.com
Hi Charles, I'm trying to do whay u explain but i'm noy able to acces the ruby config, i mean, what i understand is to change the enviroment variables of ruby and put this:


require 'compass'
Compass.configuration.parse 'compass/config.rb'

compile '/assets/style/*/' do
  filter :sass, Compass.sass_engine_options
end

route '/assets/style/*/' do
  item.identifier.chop + '.css'
end

compile '*' do
  filter :erb
  layout 'default'
end

route '*' do
 item.identifier + 'index.html'
end

layout '*', :erb

Isn't it?, cause i'm trying to acces like you sayd ( #!/usr/bin/env ruby), and i'm not able.

I understand the second part:


require 'susy'
# Require any additional compass plugins here.

project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "../output/stylesheets"
sass_dir = "src"
images_dir = "../output/images"
output_style = :compact
# To enable relative paths to assets via compass helper functions.
Uncomment:
# relative_assets = true

Is in the config.rb in the project folder.

Am I ok with my suppositions?

Thanks in advance

2009/10/6 Charles Roper <rea...@charlesroper.co.uk>

--

Diego Santamarta
www.diegosantamarta.com

Charles Roper

unread,
Oct 6, 2009, 10:09:31 AM10/6/09
to compas...@googlegroups.com
Hi Diego,

The shebang (#!/usr/bin/env ruby) is what nanoc puts at the top of its
Rules file automatically for me. It's not used on Windows and is simply
ignored. I don't know whether it *has* to be there on other platforms.

To clarify, the code we're talking about is in nanoc's Rules file. From
the Rules file, you parse the Compass config file using:

Compass.configuration.parse 'foo/config.rb'

This reads the compass configuration into Compass.sass_engine_options,
which you pass into nanoc's sass filter like this:

filter :sass, Compass.sass_engine_options

Does that make sense? Have I understood your question properly?

Charles



On 06/10/2009 14:24, Diego Santamarta wrote:
> Hi Charles, I'm trying to do whay u explain but i'm noy able to acces
> the ruby config, i mean, what i understand is to change the enviroment
> variables of ruby and put this:
>
> /require 'compass'
> Compass.configuration.parse 'compass/config.rb'
>
> compile '/assets/style/*/' do
> /
> / filter :sass, Compass.sass_engine_options
> /
> /end
>
> route '/assets/style/*/' do
> item.identifier.chop + '.css'
> end
>
> compile '*' do
> filter :erb
> layout 'default'
> end
>
> route '*' do
> item.identifier + 'index.html'
> end
>
> layout '*', :erb
> /
>
>
> Isn't it?, cause i'm trying to acces like you sayd ( #!/usr/bin/env
> ruby), and i'm not able.
>
> I understand the second part:
>
> /require 'susy'
> # Require any additional compass plugins here.
>
> project_type = :stand_alone
> # Set this to the root of your project when deployed:
> http_path = "/"
> css_dir = "../output/stylesheets"
> sass_dir = "src"
> images_dir = "../output/images"
> output_style = :compact
> # To enable relative paths to assets via compass helper functions.
> Uncomment:
> # relative_assets = true
> /
>
>
> Is in the config.rb in the project folder.
>
> Am I ok with my suppositions?
>
> Thanks in advance
>
> 2009/10/6 Charles Roper <rea...@charlesroper.co.uk
> <mailto:rea...@charlesroper.co.uk>>
> www.diegosantamarta.com <http://www.diegosantamarta.com>
>
> >

Diego Santamarta

unread,
Oct 6, 2009, 11:13:41 AM10/6/09
to Compass
Ok Charles I understand, and my last question.

I think the order in creating the project is first the NANOC project
with it's structure, i mean, it creates:

* asset_defaults.yaml
* assets
* config.yaml
* content
* layouts
* lib
* output
* page_defaults.yaml
* Rakefile
* tasks
* templates

After i add another file for Rules, that is the one we where talking
about:

* Rules



Here comes the question. If i want now a SUSY project, wich is the
next stect? to create a SUSY project inside the NANOC one or how you
do it? I assume this is the way, to create it inside, create a
comppass directory to store the modified config.rb file and in /assets/
style/ put the sass files > src folder in SUSY and the css files >
stylesheets folder in SUSY?

Here is where in'm having doubts.

Thanks
> > 2009/10/6 Charles Roper <reac...@charlesroper.co.uk
> > <mailto:reac...@charlesroper.co.uk>>
>
> >     On 06/10/2009 12:40, Diego Santamarta wrote:
> >      > Hi Chris, I'm trying to understand what u mean with this answer but i
> >      > dont really know. U mean this file?
>
> >    http://github.com/chriseppstein/compass-sinatra/blob/master/config/co...

Diego Santamarta

unread,
Oct 6, 2009, 11:30:28 AM10/6/09
to Compass
I post an image of the directory tree to check if it's correct:
http://i38.tinypic.com/72gh7q.png

Chris Eppstein

unread,
Oct 6, 2009, 12:21:29 PM10/6/09
to compas...@googlegroups.com
You got it. That location is not a standard location for the compass command line I recommend using config/compass.config

The other thing that you're going to need to set explicitly in the config file is the project_path. If you don't, compass won't know where the root folder is (usually the command line tool tells it)

I spent about an hour trying to set it up, and I think I can make it really easy to do, but I am really having a quite hard time understanding how to tell nanoc to find the sass files to compile. If you can post a nanoc project that works with normal (non-compass) sass, I will modify it to work perfectly with compass and then post the steps.

BTW, are you using nanoc 2 or nanoc 3? They appear to be quite different.

chris

Charles Roper

unread,
Oct 6, 2009, 12:25:35 PM10/6/09
to compas...@googlegroups.com
2009/10/6 Diego Santamarta <die...@gmail.com>:

>
> I post an image of the directory tree to check if it's correct:
> http://i38.tinypic.com/72gh7q.png

Diego, are you using an older version of nanoc? The default layout I'm
getting is different. You need to do "gem install nanoc3" for the
latest version.

Chris, I'll be posting a screenshot shortly of how I've setup a nanoc
site. I'm currently struggling with the same issue I had previously
with Staticmatic, that being, it doesn't seem to be able to cope with
partials.

I've posted on the nanoc group to see if I can work out what's going
on with that for sure.

Charles

Charles Roper

unread,
Oct 6, 2009, 12:35:16 PM10/6/09
to compas...@googlegroups.com
2009/10/6 Chris Eppstein <ch...@eppsteins.net>:

> tell nanoc to find the sass files to compile. If you can post a nanoc
> project that works with normal (non-compass) sass, I will modify it to work
> perfectly with compass and then post the steps.

Chris,

This screenshot should provide the info you need. I've not placed the
Compass config where you recommend but instead I've placed it in the
nanoc project root. Compass seems to compile fine in this setup.

http://i34.tinypic.com/9zn686.jpg

The trick to making nanoc compile sass files is to add an empty yaml
file of the same name. The screenshot should illustrate it.

Here's the question I posed on the nanoc group:

http://groups.google.com/group/nanoc/browse_thread/thread/f92aa2a80a3d5a8d

Charles

Chris Eppstein

unread,
Oct 6, 2009, 12:36:52 PM10/6/09
to compas...@googlegroups.com
I know how to deal with partials... you can write arbitrary ruby code in the compile block, and so you can check the filename and skip it.

E.g.

route 'something' do
  if File.basename(item.identifier)[0..0] == "_"
    nil
  else
    #compile it
  end
end

Charles Roper

unread,
Oct 6, 2009, 12:52:21 PM10/6/09
to compas...@googlegroups.com
2009/10/6 Chris Eppstein <ch...@eppsteins.net>:

> I know how to deal with partials... you can write arbitrary ruby code in the
> compile block, and so you can check the filename and skip it.

I wonder if there is some other problem going on then. Here's what I've got now:

compile '/stylesheets/*/' do


if File.basename(item.identifier)[0..0] == "_"
nil
else

filter :sass, Compass.sass_engine_options
end
end

But this is what happens when I compile:

> nanoc3 compile
Loading site data...
Compiling site...

+--- /!\ ERROR /!\ -------------------------------------------+
| An exception occured while running nanoc. If you think this |
| is a bug in nanoc, please do report it at |
| <http://projects.stoneship.org/trac/nanoc/newticket> -- |
| thanks in advance! |
+-------------------------------------------------------------+

=== MESSAGE:

Sass::SyntaxError: File to import not found or unreadable: base.sass.

=== COMPILATION STACK:

- [item] /stylesheets/ie/ (rep default)

=== BACKTRACE:

0. item /stylesheets/ie/ (rep default):9
1. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/import_node.rb:53:in
`import'
2. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/import_node.rb:33:in
`perform!'
3. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:179:in
`_perform'
4. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:156:in
`perform'
5. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:200:in
`perform_children'
6. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:200:in
`map'
7. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:200:in
`perform_children'
8. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:191:in
`perform!'
9. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:179:in
`_perform'
10. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:156:in
`perform'
11. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/tree/node.rb:103:in
`render'
12. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/haml-2.2.6/lib/sass/engine.rb:148:in
`render'
13. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/filters/sass.rb:13:in
`run'
14. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/base/item_rep.rb:166:in
`filter'
15. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/base/rule_context.rb:51:in
`filter'
16. (eval):10:in `load_rules'
17. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/base/rule.rb:32:in
`instance_eval'
18. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/base/rule.rb:32:in
`apply_to'
19. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/base/compiler.rb:175:in
`compile_rep'
20. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/base/compiler.rb:121:in
`compile_reps'
21. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/base/compiler.rb:70:in
`run'
22. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/cli/commands/compile.rb:84:in
`run'
23. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/vendor/cri/lib/cri/base.rb:91:in
`run'
24. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/lib/nanoc3/cli/base.rb:55:in
`run'
25. C:/Users/charlesr/Tools/Ruby/Ruby186/lib/ruby/gems/1.8/gems/nanoc3-3.0.1/bin/nanoc3:16
26. C:/Users/charlesr/Tools/Ruby/Ruby186/bin/nanoc3:19:in `load'
27. C:/Users/charlesr/Tools/Ruby/Ruby186/bin/nanoc3:19

Chris Eppstein

unread,
Oct 6, 2009, 12:54:47 PM10/6/09
to compas...@googlegroups.com
Yep. That's because sass load paths aren't configured properly. Did you set project_path in your config file to the top of the project?

Charles Roper

unread,
Oct 6, 2009, 1:24:13 PM10/6/09
to compas...@googlegroups.com
2009/10/6 Chris Eppstein <ch...@eppsteins.net>:

> Yep. That's because sass load paths aren't configured properly. Did you set
> project_path in your config file to the top of the project?

Aaaah, that got it. I had set project_root, instead of project_path. Doh.

Here's what my config.rb (compass config) now looks like:

require 'susy'
# Require any additional compass plugins here.

project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"

project_path = "."
css_dir = "output/stylesheets"
sass_dir = "content/stylesheets"
images_dir = "output/stylesheets"


output_style = :compact
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true


And this is my Rules file (note how I don't need to use the ignore
partials trick you mentioned earlier; that's because nanoc ignores
files without a companion yaml file.)

#!/usr/bin/env ruby

require 'compass'
Compass.configuration.parse 'config.rb'

compile '/stylesheets/*/' do
filter :sass, Compass.sass_engine_options
end

route '/stylesheets/*/' do

Chris Eppstein

unread,
Oct 6, 2009, 1:38:54 PM10/6/09
to compas...@googlegroups.com
These companion files are annoying and useless in this case.

I bet we could write a SassDataSource that makes nanoc work without them and just ignore the partials.

chris

Denis Defreyne

unread,
Oct 6, 2009, 3:59:09 PM10/6/09
to Compass
Hi,

Apologies for chiming in in the middle of the thread—I'm probaby
missing a few important details…

On Oct 6, 6:36 pm, Chris Eppstein <ch...@eppsteins.net> wrote:

> I know how to deal with partials... you can write arbitrary ruby code in the
> compile block, and so you can check the filename and skip it.
> E.g.
>
> route 'something' do
> if File.basename(item.identifier)[0..0] == "_"
> nil
> else
> #compile it
> end
> end

A #route block that returns nil will prevent the output file file from
being written, but the item will still be compiled, i.e. the #compile
block will still be called. If you don't want any compilation to take
place, make sure the matching #compile block is empty.

On Oct 6, 5:13 pm, Diego Santamarta <dieg...@gmail.com> wrote:

> I think the order in creating the project is first the NANOC project
> with it's structure, i mean, it creates:
>
> * asset_defaults.yaml
> * assets
> * config.yaml
> * content
> * layouts
> * lib
> * output
> * page_defaults.yaml
> * Rakefile
> * tasks
> * templates

You are using an older version of nanoc (nanoc 2). The Rules file is
new in nanoc 3, and I believe that integrating Compass in nanoc 2 will
be quite a bit more difficult than doing so in nanoc 3. You should
migrate if you can (http://nanoc.stoneship.org/migrating/). :)

On Oct 6, 7:38 pm, Chris Eppstein <ch...@eppsteins.net> wrote:

> These companion files are annoying and useless in this case.
> I bet we could write a SassDataSource that makes nanoc work without them and
> just ignore the partials.

In nanoc 3.1 these YAML metadata files will be optional when using any
of the filesystem-based data sources (the default filesystem_compact
one, but also the other filesystem_verbose and filesystem_combined
ones). :)

Regards,

Denis

Charles Roper

unread,
Oct 7, 2009, 3:32:54 AM10/7/09
to compass-users
Chris,

Some further thoughts on Sass integration from Denis over on the nanoc group:

http://groups.google.com/group/nanoc/browse_thread/thread/f92aa2a80a3d5a8d

Charles

Chris Eppstein

unread,
Oct 7, 2009, 4:48:09 AM10/7/09
to compas...@googlegroups.com
I have to say that all sounds very complicated to account for a feature that no one has ever asked for (remote sass). I wouldn't want to leave the design of my site in the hands of some remote location, that makes change management very hard even if I have control over both sides.

I still think, from my limited understanding, that a custom data source is the easiest way to make nanoc act like sass expects it to -- I can't imagine any value from the more advanced features of nanoc being useful with sass. Processing sass or sass-generated-css is just a little to meta for even me.

chris

Denis Defreyne

unread,
Nov 2, 2009, 1:41:45 PM11/2/09
to Compass
Hi,

On Oct 7, 9:48 am, Chris Eppstein <ch...@eppsteins.net> wrote:

> I have to say that all sounds very complicated to account for a feature that
> no one has ever asked for (remote sass). I wouldn't want to leave the design
> of my site in the hands of some remote location, that makes change
> management very hard even if I have control over both sides.

This feature indeed isn’t useful for Sass, but it can be used for
fetching data from Twitter, Delicious, Last.fm etc.

> I still think, from my limited understanding, that a custom data source is
> the easiest way to make nanoc act like sass expects it to -- I can't imagine
> any value from the more advanced features of nanoc being useful with sass.
> Processing sass or sass-generated-css is just a little to meta for even me.

I’m not following you there… the default data source, which reads
pages from content/, should work just fine.

FWIW, I’ve found an error in the compass configuration file (foo/
config in a few posts above). The paths in this file are incorrect;
they should not be relative to the foo/ directory, but rather to the
project directory (and there is no way to change that behavior as far
as I can tell). So, this won’t work:

css_dir = "../output/stylesheets"
images_dir = "../output/images"

but this will, though:

css_dir = "output/stylesheets"
images_dir = "output/images"

Also, sass_dir should be set to where the sass files are located. The
original configuration file says

sass_dir = "src"

but nanoc does not have a “src” directory; it has a directory
“content” in which pages, stylesheets, … can be stored. So, this line
should instead say

sass_dir = "content/assets/style"

Compass will work just fine now; partials will also function correctly
and don’t need the entire path (e.g. no need for “@import content/
assets/style/foo” but just “@import foo”). See this post on the nanoc
mailinglist for details: http://groups.google.com/group/nanoc/msg/29d3f51cdab6ba55.

Having spent a bit of time using Compass and Sass, I’m finally getting
the hang of it and I’m quite impressed so far. I’m considering using
it in real projects, but right now everything’s still in the
“experimenting” stage. Nice work. :)

Hope this helps,

Denis

Chris Eppstein

unread,
Nov 2, 2009, 1:46:29 PM11/2/09
to compas...@googlegroups.com
Awesome work. Could you put a simple project up on github that ties it all together?

chris

Diego Santamarta

unread,
Nov 4, 2009, 11:41:20 AM11/4/09
to compas...@googlegroups.com
Yes please, that would be good for all of us. Thanks in advance.

2009/11/2 Chris Eppstein <ch...@eppsteins.net>



--

Diego Santamarta
www.diegosantamarta.com

Denis Defreyne

unread,
Nov 6, 2009, 1:39:29 PM11/6/09
to Compass
On Nov 2, 7:46 pm, Chris Eppstein <ch...@eppsteins.net> wrote:

> Awesome work. Could you put a simple project up on github that ties it all together?

I created nanoc-bootstrap-compass at http://github.com/ddfreyne/nanoc-bootstrap-compass.
It should work right out of the box (assuming nanoc3 and compass gems
are installed). If anyone has trouble getting this to work properly,
be sure to let me know (on this thread, on the nanoc mailinglist or
using direct e-mail).

Regards,

Denis

Chris Eppstein

unread,
Nov 6, 2009, 2:14:27 PM11/6/09
to compas...@googlegroups.com
Many thanks! I added a link from the wiki page:


Is the information there accurate?

Diego Santamarta

unread,
Nov 6, 2009, 6:14:54 PM11/6/09
to compas...@googlegroups.com
Hi, i'm trying to do this work, but i'm getting this error when i try to compile in nanoc3:

Errno::ENOENT: /usr/local/lib/ruby/gems/1.8/gems/chriseppstein-compass-0.8.17/lib/compass/configuration.rb:36:in `initialize': No such file or directory - compass.rb


Does anybody knows why this can happend?

Thanks in advance.

2009/11/6 Chris Eppstein <ch...@eppsteins.net>



--

Diego Santamarta
www.diegosantamarta.com

Chris Eppstein

unread,
Nov 6, 2009, 6:19:05 PM11/6/09
to compas...@googlegroups.com
It sounds like it can't find the configuration file. it's looking for compass.rb which isn't the normal configuration file name, so it may need to be renamed.

chris

Diego Santamarta

unread,
Nov 6, 2009, 9:40:11 PM11/6/09
to compas...@googlegroups.com
Thanks Chris, It was a mistake in the Rules file. With all the mess making it work with Susy i forgot to change that.

2009/11/6 Chris Eppstein <ch...@eppsteins.net>



--

Diego Santamarta
www.diegosantamarta.com
Reply all
Reply to author
Forward
0 new messages