Here’s a list of the PieCrust pipeline’s asset processors that ship with PieCrust by default.
Configuration settings for asset processors must be defined in the website configuration, unless noted otherwise.
Browserify
Compiles Javascript files using Browserify.
Name: browserify
This processor isn’t used unless the browserify
configuration exists. It can
simply be set to true
.
Configuration settings (under browserify/
):
bin
: the path to the Browserify executable. Defaults tobrowserify
.
CleanCSS
Compresses CSS files using the cleancss
utility.
Name: cleancss
Configuration settings (under cleancss/
):
-
bin
: The name or path of thecleancss
executable. Defaults tocleancss
, which means it’s expected you have it in yourPATH
. -
options
: A list of miscellaneous options to pass tocleancss
. Defaults to--skip-rebase
.
Compass
A processor that runs compass
as part of the bake.
Name: compass
Configuration settings (under compass/
):
-
enable
: This processor is disabled by default. You need to set this setting totrue
. -
bin
: The name or path of thecompass
executable. Defaults tocompass
, which means it’s expected you have it in yourPATH
. -
frameworks
: The list of frameworks to enable. -
options
: A list of miscellaneous options to pass tocompass
. You can use the placeholders%out_dir%
and%tmp_dir%
to refer to the temporary and output directories of the current bake.
Notes:
-
It’s expected that the Compass configuration file is called
config.rb
and is located in your website’s root directory. -
To troubleshoot any problems, run
chef
with the--debug
option to see the full command-line invocation ofcompass
.
Concat
A simple processor that concatenates multiple other files.
The input for this processor must be a .concat
file whose file name without
the .concat
extension will be the output file name. The contents must be a
YAML configuration that lists the files to concatenate.
So for instance, a foo.js.concat
file will generate an output file named
foo.js
. If the concents of the .concat
file are the same as below, it will
end up being the concatenation of files something.js
and lib/vendor/blah.js
:
files:
- foo.js
- lib/vendor/blah.js
Other settings are possible in the YAML file:
-
path_mode
: Eitherrelative
orabsolute
. Ifrelative
, thefiles
list specifies files relative to the.concat
file. Otherwise, they’re relative to the asset root directory. -
delim
: The delimiter string to use between each concatenated file. Defaults to a line feed (\n
).
Copy
A simple processor that copies the input file to the same place (relative to the asset directory, and to the output directory).
Name: copy
LessCSS
Converts LESS CSS files into normal CSS.
Name: less
Configuration settings (under less/
):
-
bin
: The name or path of thelessc
executable. Defaults tolessc
, which means it’s expected you have it in yourPATH
. -
options
: A list of miscellaneous options to pass tolessc
. Defaults to--compress
.
Sass
Converts Sass files (.scss
, .sass
) into normal CSS.
Name: sass
Configuration settings (under sass/
):
-
bin
: The name or path of thescss
executable. Defaults toscss
, which means it’s expected you have it in yourPATH
. -
style
: The output CSS style. Defaults tonested
. -
load_paths
: A list of additional include paths. Defaults to an empty list. -
options
: A list of miscellaneous options to pass tolessc
. Defaults to an empty list.
Sitemap
Creates a Sitemap file by transforming a .sitemap
file into a .xml
file of
the same name with contents that match the Sitemap specification.
The .sitemap
must be a YAML file (i.e. something a bit like the website
configuration file) that can contain either:
-
locations
: A list of locations to include in the Sitemap file. Each location must have aurl
setting. Optionally, they can have alastmod
,changefreq
, and/orpriority
setting. This is basically boiling down to writing the Sitemap in YAML instead of XML. -
autogen
: This should be a list of page source names for which to auto-generate the Sitemap. Each source listed here will have all its pages included in the Sitemap. Theurl
andlastmod
of each entry will be set accordingly to their corresponding page. Each page can define asitemap
configuration setting to override or add to the corresponding entry.
UglifyJS
Compresses Javascript files using the uglifyjs
utility.
Name: uglifyjs
Configuration settings (under uglifyjs/
):
-
bin
: The name or path of theuglifyjs
executable. Defaults touglifyjs
, which means it’s expected you have it in yourPATH
. -
options
: A list of miscellaneous options to pass touglifyjs
. Defaults to--compress
.