This plugin requires Grunt ~0.4.0 and Jekyll >= v1.0.0.
If you haven't used Grunt before, be sure to check out the Getting Started guide which explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process you may install this plugin with the command:
npm install grunt-jekyll --save-devAfter the plugin has been installed, load it in your Gruntfile with:
grunt.loadNpmTasks('grunt-jekyll');Run this task with the grunt jekyll command.
This task helps you compile your Jekyll static site with Grunt.
-
serve
Type:
booleanDefault:falseBuild the site and start a Jekyll development server on
http://localhost:4000. The server lasts forever: kill it with Ctrl + C.If
serveis false, the site is built with thebuildcommand.For complex projects you may want to use grunt-contrib-connect or grunt-browser-sync instead.
-
doctor
Type:
booleanDefault:falseTest your site for common errors and deprecated code. Ignores all other options except
src,config, andbundleExec.
You can use all of the configuration options available in the Jekyll Documentation, as well as some special options provided by this plugin.
-
src
Type:
stringDefault:.Directory where Jekyll will read files.
-
dest
Type:
stringDefault:./_siteDirectory where Jekyll will write files.
-
[no_]watch
Type:
booleanDefault:falseRegenerate the site when files are modified. If you are running multiple watch tasks in a project you should use grunt-contrib-watch instead.
-
config
Type:
stringDefault:_config.ymlSpecify a custom configuration file. Multiple files separated by a comma will cascade right to left.
-
raw
Type:
stringCreate a temporary _config.yml with the contents of
raw. This config file has greater precedence than the files inconfig. -
safe
Type:
booleanDefault:falseDisables custom plugins, and ignore symbolic links.
-
plugins
Type:
stringDefault:./_pluginsSpecify a plugins directory.
-
layouts
Type:
stringDefault:./_layoutsSpecify a layouts directory.
-
drafts
Type:
booleanDefault:falseProcess and render draft posts.
-
future
Type:
booleanDefault:falsePublishes posts with a future date.
-
lsi
Type:
booleanDefault:falseProduce an index for related posts.
-
limit_posts
Type:
numberLimit the number of posts to parse and publish.
-
force_polling
Type:
booleanForce watch to use polling.
-
verbose
Type:
booleanPrint verbose output.
-
quiet
Type:
booleanSilence the normal output from Jekyll during a build.
-
incremental
Type:
booleanEnable the experimental incremental build feature. Incremental build only re-builds posts and pages that have changed, resulting in significant performance improvements for large sites, but may also break site generation in certain cases.
-
livereload
Type:
booleanLiveReload refreshes your browser after a change.
-
port
Type:
stringornumberListen on the given port (requires
serve). -
host
Type:
stringListen at the given hostname (requires
serve). -
baseurl
Type:
stringServe the website from the given base URL (requires
serve). -
skip_initial_build
Type:
booleanSkips the initial site build which occurs before the server is started.
-
open_url
Type:
booleanOpens the local URL in your default browser.
-
bundleExec
Type:
booleanDefault:falseRun
jekyllwith bundle exec.
Follow this Grunt example to get started with grunt-jekyll right away.
grunt.initConfig({
jekyll: { // Task
options: { // Universal options
bundleExec: true,
src : '<%= app %>'
},
dist: { // Target
options: { // Target options
dest: '<%= dist %>',
config: '_config.yml,_config.build.yml'
}
},
serve: { // Another target
options: {
serve: true,
dest: '.jekyll',
drafts: true,
future: true
}
}
}
});
grunt.loadNpmTasks('grunt-jekyll');
grunt.registerTask('default', ['jshint', 'jekyll']);grunt.initConfig({
jekyll: {
dist: {
options: {
config: '_config.yml',
// Construct a string with JavaScript.
// Remember, in YAML line breaks and indentation matter.
raw: 'pygments: false\n' +
'exclude: [\'development\']\n' +
'author:\n' +
' name: ' + fetchAuthor() + '\n' +
' email: ' + fetchEmail()
}
}
}
});- See CHANGELOG.md for further updates
- v0.4.3: More options support for Jekyll 3.0.0
- v0.4.2: More internal optimizations.
- v0.4.1: Internal optimizations.
- v0.4.0: Added setup for tests.
- v0.3.9: Consolidating branches and bumping version number.
- v0.3.8: Added @robwierzbowski's raw option and other PRs.
- v0.3.6:
- Reviewed Jekyll's source and updated plugin with new flags.
- Reviewed and warned about deprecated flags.
- Updated documentation to match flag updates. (Rewritten as a list)
- v0.3.3: Updated link in documentation. Added to-do list.
- v0.3.2: Added option to select config file. Removed deprecated
--pygmentsoption flag. Bugfixes. - v0.3.0: Update for Jekyll 1.0
- v0.2.1: Fixed destination path option.
- v0.2.0: Updated README with better options. Options are more flexible.
- v0.1.6: Updated README with better example.
- v0.1.0: Initial Release.
MIT