配置选项(Configuration Options)
The tables below list the available settings for Jekyll, and the various options
(specified in the configuration file) and flags
(specified on the command-line) that control them.
全局配置
Setting | Options and Flags |
---|---|
Site source Change the directory where Jekyll will read files |
|
Site destination Change the directory where Jekyll will write files |
|
Safe Disable non-whitelisted plugins, caching to disk, and ignore symbolic links. |
|
Disable disk cache 4.1.0 Disable caching of content to disk in order to skip creating a |
|
Ignore theme configuration 4.1.0 Jekyll 4.0 started allowing themes to bundle a |
|
Exclude Exclude directories and/or files from the conversion. These exclusions are relative to the site's source directory and cannot be outside the source directory.
|
|
Include Force inclusion of directories and/or files in the conversion. |
|
Keep files When clobbering the site destination, keep the selected files. Useful for files that are not generated by jekyll; e.g. files or assets that are generated by your build tool. The paths are relative to the |
|
Time zone Set the time zone for site generation. This sets the |
|
Encoding Set the encoding of files by name (only available for Ruby 1.9 or later). The default value is |
|
Defaults Set defaults for front matter variables. |
see below |
Destination folders are cleaned on site builds
The contents of <destination>
are automatically
cleaned, by default, when the site is built. Files or folders that are not
created by your site will be removed. Some files could be retained
by specifying them within the <keep_files>
configuration directive.
Do not use an important location for <destination>
; instead, use it as
a staging area and copy files from there to your web server.
Build Command Options
Setting | Options and Flags |
---|---|
Regeneration Enable auto-regeneration of the site when files are modified. |
|
Configuration Specify config files instead of using |
|
Plugins Specify plugin directories instead of using |
|
Layouts Specify layout directory instead of using |
|
Drafts Process and render draft posts. |
|
Environment Use a specific environment value in the build. |
|
Future Publish posts or collection documents with a future date. |
|
Unpublished Render posts that were marked as unpublished. |
|
LSI Produce an index for related posts. Requires the classifier-reborn plugin. |
|
Limit posts Limit the number of posts to parse and publish. |
|
Force polling Force watch to use polling. |
|
Verbose output Print verbose output. |
|
Silence output Silence the normal output from Jekyll during a build. |
|
Log level Specify a log level among debug, info, warn, or error. |
|
Incremental build Enable 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. |
|
Disable bundle require Disables the need to require gems in `:jekyll_plugins` Gemfile |
|
Liquid profiler Generate a Liquid rendering profile to help you identify performance bottlenecks. |
|
Strict front matter Cause a build to fail if there is a YAML syntax error in a page's front matter. |
|
Base URL Serve the website from the given base URL. |
|
Trace Show the full backtrace when an error occurs. |
|
Serve Command Options
In addition to the options below, the serve
sub-command can accept any of the options
for the build
sub-command, which are then applied to the site build which occurs right
before your site is served.
Setting | Options and Flags |
---|---|
Local server port Listen on the given port. The default is `4000`. |
|
Local server hostname Listen at the given hostname. The default is `localhost`. |
|
Live reload Reload a page automatically on the browser when its content is edited. |
|
Live reload ignore File glob patterns for LiveReload to ignore. |
|
Live reload min/max delay Minimum/Maximum delay before automatically reloading page. |
|
Live reload port Port for LiveReload to listen on. |
|
Open URL Open the site's URL in the browser. |
|
Detach Detach the server from the terminal. |
|
Skips the initial site build Skips the initial site build which occurs before the server is started. |
|
Show directory listing Show a directory listing instead of loading your index file. |
|
X.509 (SSL) private key SSL Private Key, stored or symlinked in the site source. |
|
X.509 (SSL) certificate SSL Public certificate, stored or symlinked in the site source. |
|
Do not use tabs in configuration files
This will either lead to parsing errors, or Jekyll will revert to the default settings. Use spaces instead.