assemble / assemble-less

Grunt task for compiling LESS to CSS. This task does for less what Assemble does for HTML, making it much easier to modularize and reduce repetition in stylesheets.
http://github.com/assemble/assemble/
MIT License
66 stars 20 forks source link

Pass metadata to Lo-Dash templates #33

Closed laraduarte closed 9 years ago

laraduarte commented 9 years ago

Hi, i am trying to use metadata, but this is not working.

i have this file - utils/data/yml/palette.yml with this content

palette.yml

topBarBg: "purple"

on my settings file i have - @topBarBg : <%= palette.topBarBg %>;

When i run override task the @topBarBg remains with the value <%= palette.topBarBg %>; and not purple. What am i doing wrong? can you help please?

    less: {
        override: {
            options: {
                metadata: 'utils/data/yml/*.{json,yml}'
            },
            styles: {
                files: {
                    "app/css/app.css": ["app/less/app.less"]
                }
            }
        }
    },
doowb commented 9 years ago

Looks like you need to set process: true for it to run the source files through lodash.

    less: {
        override: {
            options: {
                process: true,
                metadata: 'utils/data/yml/*.{json,yml}'
            },
            styles: {
                files: {
                    "app/css/app.css": ["app/less/app.less"]
                }
            }
        }
    },