FrontMatter

Extracts the first part of content for each document and sends it to a child module for processing.
This module is typically used in conjunction with the Yaml module to enable putting YAML front matter in a file. First, the content of each input document is scanned for a line that consists entirely of the delimiter character or (- by default) or the delimiter string. Once found, the content before the delimiter is passed to the specified child modules. Any metadata from the child module output document(s) is added to the input document. Note that if the child modules result in more than one output document, multiple clones of the input document will be made for each one. The output document content is set to the original content without the front matter.

Usage

  • FrontMatter(char delimiter, IEnumerable<IModule> modules)

    Uses the specified delimiter character and passes any front matter to the specified child modules for processing.

    • delimiter

      The delimiter to use.

    • modules

      The modules to execute against the front matter.

  • FrontMatter(char delimiter, params IModule[] modules)

    Uses the specified delimiter character and passes any front matter to the specified child modules for processing.

    • delimiter

      The delimiter to use.

    • modules

      The modules to execute against the front matter.

  • FrontMatter(IEnumerable<IModule> modules)

    Uses the default delimiter character and passes any front matter to the specified child modules for processing.

    • modules

      The modules to execute against the front matter.

  • FrontMatter(params IModule[] modules)

    Uses the default delimiter character and passes any front matter to the specified child modules for processing.

    • modules

      The modules to execute against the front matter.

  • FrontMatter(string delimiter, IEnumerable<IModule> modules)

    Uses the specified delimiter string and passes any front matter to the specified child modules for processing.

    • delimiter

      The delimiter to use.

    • modules

      The modules to execute against the front matter.

  • FrontMatter(string delimiter, params IModule[] modules)

    Uses the specified delimiter string and passes any front matter to the specified child modules for processing.

    • delimiter

      The delimiter to use.

    • modules

      The modules to execute against the front matter.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • IgnoreDelimiterOnFirstLine(bool ignore = true)

    Ignores the delimiter if it appears on the first line. This is useful when processing Jekyll style front matter that has the delimiter both above and below the front matter content. The default behavior is true.

    • ignore

      If set to true, ignore the delimiter if it appears on the first line.

GitHub