Configuration

text_extensions

A list of file extensions that Nanoc will consider to be textual rather than binary. If an item with an extension not in this list is found, the file will be considered as binary.

text_extensions: [ 'adoc', 'asciidoc', 'atom', 'coffee', 'css', 'erb', 'haml', 'handlebars', 'hb', 'htm', 'html', 'js', 'less', 'markdown', 'md', 'ms', 'mustache', 'php', 'rb', 'rdoc', 'sass', 'scss', 'slim', 'txt', 'xhtml', 'xml' ]

output_dir

The path to the directory where all generated files will be written to. This can be an absolute path starting with a slash, but it can also be a path relative to the site directory.

output_dir: output

index_filenames

A list of index filenames, i.e. names of files that will be served by a web server when a directory is requested. Usually, index files are named index.html, but depending on the web server, this may be something else, such as default.html. This list is used by Nanoc to generate pretty URLs.

index_filenames: [ 'index.html' ]

enable_output_diff

Whether or not to generate a diff of the compiled content when compiling a site. The diff will contain the differences between the compiled content before and after the last site compilation.

enable_output_diff: false

prune

The prune section contains options for the prune command, which deletes stray files from the output directory.

prune:
  auto_prune: true
  exclude: [ '.git', '.hg', '.svn', 'CVS' ]

When auto_prune is true, Nanoc will automatically remove files not managed by Nanoc from the output directory.

The exclude option determines which files and directories you want to exclude from pruning. If you version your output directory, you should probably exclude VCS directories such as .git or .hg.

commands_dirs

Directories to read commands from. This is useful when you have a set of commands that you want to share between sites.

commands_dirs: [ '../shared-commands' ]

data_sources

The data sources configuration contains the definition of the data sources of this site. It is a list of hashes with keys described in the sections below; each array element represents a single data source. For example:

data_sources:
  -
    type: pentabarf # a custom data source
    items_root: /conference/

For details, see the Data sources page.

string_pattern_type

Sets the type of string pattern to use. Can be glob or legacy. See the Identifiers and patterns page for details.

string_pattern_type: glob

checks

The checks section contains the configuration for individual checks.

Defines the configuration for the internal_links check.

exclude (default: empty array)
A list of patterns, specified as regular expressions, to exclude from the check. If an internal link matches this pattern, the validity check will be skipped.

For example, the following will exclude all links starting with /server_status from being marked as broken:

checks:
  internal_links:
    exclude: ['^/server_status']

Defines the configuration for the external_links check.

exclude (default: empty array)
A list of patterns, specified as regular expressions, to exclude from the check. If an external link matches this pattern, the validity check will be skipped.
exclude_files (default: empty array)
A list of file patterns, specified as regular expressions, to exclude from the check. If a file matches this pattern, the links from this file will not be checked.

For example, the following will exclude all links to example.com, as well as all links on blog/page, from being marked as broken:

checks:
  external_links:
    exclude: ['^/server_status']
    exclude_files: ['blog/page']