dannygarcia/grunt-jekyll — pull request #20 by robwierzbowski (2013-05-27 16:55:29+00:00)
Title: Add `raw` option

This adds a `raw` option to the plugin. Raw lets you add any values to a temporary _config.yml, which is then added to the `--config` cascade. For example:

```js
dist: {
options: {
dest: '<%= yeoman.dist %>',
config: '_config.yml,_config.build.yml',
raw: 'author:' +
'\n name: Rob Wierzbowski' +
'\n email: hello@robwierzbowski.com' +
'\npygments: false'
}
}
```
creates a temporary _config.HASH.yml file containing:

```yml
author:
name: Rob Wierzbowski
email: hello@robwierzbowski.com
pygments: false
```

and adds it to the command like so:

```
// Terminal output
Running "jekyll:dist" (jekyll) task
`jekyll build --source app --destination dist --config _config.yml,_config.build.yml,/var/folders/9x/mtztd0zj7gzd7b6kfll1r4jh0000gn/T/_config.8194l7agv9s.yml` was initiated.

Jekyll output:
Configuration file: _config.yml
Configuration file: _config.build.yml
Configuration file: /var/folders/9x/mtztd0zj7gzd7b6kfll1r4jh0000gn/T/_config.8194l7agv9s.yml
Source: app
Destination: dist
Generating... done.
```

The temp file is cleaned up on process end.

So using this you can set non-command line properties in the Gruntfile, including any custom properties you like for templating, etc.

-----

**Couple notes:**

Based on raw in [grunt-contrib-compass](https://github.com/gruntjs/grunt-contrib-compass).

This continues from and includes the commits in https://github.com/dannygarcia/grunt-jekyll/pull/14, but isn't necessarily tied to it. If you pull or decline that PR I'll rebase this one. I included the commits for now so if you want you can play around with a working branch.

Will need docs, which I can write up.

Should play well with my other small PRs.