Skip to content

Working with patternlab scaffolding

Dennis Heibuelt edited this page May 27, 2015 · 7 revisions

Directories

Your working directory is source/.

public/ is Pattern Labs destination folder where everything comes in automatically and gets displayed in the browser. So don't ever touch files in there!

Watcher

As long as you have $ grunt dev and $ php core/builder.php -wrp running in parallel, every change of source code in source/ is recognized. Consequently, the particular compilation takes effect and the compiled files are copied into public/. Ultimately the browser is reloaded automatically.

Cms path adjustment

When you are working with a content managment system such as WordPress, patternlab-scaffolding provides the feature to copy the CSS/JavaScript/Fonts automatically to the correspondent path of the cms. Therefore you must adjust that path in the Gruntfile.js:

cms: {
    css: 'cms/css',
    stylesheet: 'cms/css/style.css',
    js: 'cms/js',
    fonts: 'cms/fonts'
}

By these default settings, the CSS/JavaScript/Fonts will go into a cms/ folder in the projects' root directory.

To match the path, e.g. for a WordPress project, the configuration will look like this:

cms: {
    css: '../wordpress/wp-content/themes/twentyfifteen',
    stylesheet: '../wordpress/wp-content/themes/twentyfifteen/style.css',
    js: '../wordpress/wp-content/themes/twentyfifteen/js',
    fonts: '../wordpress/wp-content/themes/twentyfifteen/fonts'
}
Clone this wiki locally