Search code examples
configurationcompass-sasssassdirectory-structure

sass/scss/compass: how to set default project file structure


At the first, i am new to sass/compass and think it is a big step forward. But I still have a small problem. I try to set a default folder structure for new projects.

So, if i create a new project with:

compass create

it outputs the following folder structure for example:

├───.sass-cache
├───sass
│   ├───ie.scss
│   ├───print.scss
│   └───screen.scss
└───stylesheets
    ├───ie.css
    ├───print.css
    └───screen.css

what can I do now, to say compass that I want a structure like that, for every new project:

├───.sass-cache
├───css
│   ├───ie.css
│   ├───print.css
│   └───screen.css
├───img
│   ├───ico
│   ├───jpg
│   └───png
├───js
│   ├───jquery-1.7.2.min.js
│   └───scripts.js
└───sass
    ├───ie.scss
    ├───print.scss
    ├───screen.scss
    ├───_config.scss
    └───_mixins.scss

Is there a default-config.rb where i can define which files to load or do I have to create this structure manually for every new project?

I thank you in advance!

EDIT

Okay, I have found the best answer by myself:

Just create an extension for compass. So you can build your own folder & file structure.

Here is a nice starting point.

To create then a new project enter that compass create <project-name> -r extension_name -u gem_name into the terminal/console.

For everyone who needs a starter kit for that, take a look at my port of the "Kube Framework": compass-kube


Solution

  • Your preferred project structure isn't something Compass should handle. Instead, you should have your own skeleton, barebones, bootstrapped, template starting point which you copy to start new projects:

    cp -r ~/barebones-project-starter .
    

    or clone from a hosted version control system:

    git clone https://github.com/kumiau/default-project