Settings

You can specify global settings that are available from the current `IExecutionContext`. This is often used by recipes to configure the generation and control different options. You can also use settings to pass information from your configuration file to [Razor](/modules/razor) templates or anything else that has access to the current `IExecutionContext`. Note that the settings dictionary values are objects, so you can store simple primitive values or complex structures as well.

Settings["Foo"] = "Bar";

Additionally, settings are inherited as metadata in each document. Every pipeline starts with a single document that has had it's metadata populated with the settings you specify in the configuration file. You can use this facility to introduce variables that can influence the way the pipeline behaves or to initialize documents with initial values for document-specific metadata.

Recipes and themes may also introduce their own settings.

The following is a list of all global settings that you can set in the configuration file:

  • Keys.CleanOutputPath: System.Boolean

    Indicates whether to clean the output path on each execution.

  • Keys.DateTimeDisplayCulture: System.String or System.Globalization.CultureInfo

    Indicates the culture to use for displaying dates in output.

  • Keys.DateTimeInputCulture: System.String or System.Globalization.CultureInfo

    Indicates the culture to use for reading and interpreting dates as input.

  • Keys.Host: System.String

    The host to use when generating links.

  • Keys.LinkHideExtensions: System.Boolean

    Indicates whether to hide ".html" and ".htm" extensions by default when generating links.

  • Keys.LinkHideIndexPages: System.Boolean

    Indicates whether to hide index pages by default when generating links.

  • Keys.LinkRoot: System.String

    The default root path to use when generating links (for example,

    "/virtual/directory"
    ). Note that you may also want to use the
    --virtual-dir
    argument on the command line when using this setting so that the preview server serves the site at the same path as the generated links (for example,
    --virtual-dir "/virtual/directory"
    ).

  • Keys.LinksUseHttps: System.Boolean

    Indicates if generated links should use HTTPS instead of HTTP as the scheme.

  • Keys.UseCache: System.Boolean

    Indicates whether caching should be used.

GitHub