jekyll/site/docs/configuration.md

8.4 KiB
Raw Blame History

layout title prev_section next_section permalink
docs Configuration structure frontmatter /docs/configuration/

Jekyll allows you to concoct your sites in any way you can dream up, and its thanks to the powerful and flexible configuration options that this is possible. These options can either be specified in a _config.yml file placed in your sites root directory, or can be specified as flags for the jekyll executable in the terminal.

Configuration Settings

Global Configuration

The table below lists the available settings for Jekyll, and the various options (specifed 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

source: DIR

-s, --source DIR

Site Destination

Change the directory where Jekyll will write files

destination: DIR

-d, --destination DIR

Safe

Disable custom plugins.

safe: BOOL

--safe

Exclude

Exclude directories and/or files from the conversion

exclude: [DIR, FILE, ...]

Include

Force inclusion of directories and/or files in the conversion. .htaccess is a good example since dotfiles are excluded by default.

include: [DIR, FILE, ...]

Time Zone

Set the time zone for site generation. This sets the TZ environment variable, which Ruby uses to handle time and date creation and manipulation. Any entry from the IANA Time Zone Database is valid, e.g. America/New_York. The default is the local time zone, as set by your operating system.

timezone: TIMEZONE

Build Command Options

Setting Options and Flags

Regeneration

Enable auto-regeneration of the site when files are modified.

-w, --watch

Configuration

Specify a config file. Overrides settings in _config.yml

--config FILE

Drafts

Process and render draft posts.

--drafts

Future

Publish posts with a future date.

future: BOOL

--future

LSI

Produce an index for related posts.

lsi: BOOL

--lsi

Limit Posts

Limit the number of posts to parse and publish.

limit_posts: NUM

--limit_posts NUM

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.

port: PORT

--port PORT

Local Server Hostname

Listen at the given hostname.

host: HOSTNAME

--host HOSTNAME

Base URL

Serve website with the given base URL

baseurl: URL

--baseurl URL

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.

Default Configuration

Jekyll runs with the following configuration options by default. Unless alternative settings for these options are explicitly specified in the configuration file or on the command-line, Jekyll will run using these options.

{% highlight yaml %} source: . destination: ./_site plugins: ./_plugins layouts: ./_layouts keep_files: ['.git','.svn']

future: true pygments: false

markdown: maruku permalink: date include: ['.htaccess'] paginate_path: 'page:num'

markdown_ext: markdown,mkd,mkdn,md textile_ext: textile

excerpt_separator: "\n\n"

safe: false watch: false server: false host: 0.0.0.0 port: 4000 baseurl: / url: http://localhost:4000 lsi: false

maruku: use_tex: false use_divs: false png_engine: blahtex png_dir: images/latex png_url: /images/latex

rdiscount: extensions: []

redcarpet: extensions: []

kramdown: auto_ids: true footnote_nr: 1 entity_output: as_char toc_levels: 1..6 smart_quotes: lsquo,rsquo,ldquo,rdquo use_coderay: false

coderay: coderay_wrap: div coderay_line_numbers: inline coderay_line_numbers_start: 1 coderay_tab_width: 4 coderay_bold_every: 10 coderay_css: style

redcloth: hard_breaks: true {% endhighlight %}