CLASS FrontMatter

A scaffold structure to help creating system-generated content, like tag, section or index pages

Properties

Title

(string?) { get; set } = string.Empty

Type

(string?) { get; set } = "page"

Url

(string?) { get; set }

Draft

(bool?) { get; set }

Aliases

(List?) { get; set }

Section

(string?) { get; set } = string.Empty

Date

(DateTime?) { get; set }

LastMod

(DateTime?) { get; set }

PublishDate

(DateTime?) { get; set }

ExpiryDate

(DateTime?) { get; set }

Weight

(int) { get; set }

Tags

(List?) { get; set }

ResourceDefinitions

(List?) { get; set }

Params

(Dictionary<string, object>) { get; set } = []

Cascade

(FrontMatter?) { get; set }: Cascade front matter data to its children.

Public Methods

Parse

public static FrontMatter Parse(string frontMatterString, string fileFullPath, string fileRelativePath, IFrontMatterParser parser)

Create a front matter from a given front matter + content

Parameters:

  • frontMatterString (string)
  • fileFullPath (string)
  • fileRelativePath (string)
  • parser (IFrontMatterParser)

Returns: FrontMatter

Parse

public static (FrontMatter, string) Parse(string fileFullPath, string fileRelativePath, IFrontMatterParser parser, string content)

Create a front matter from a given content

Parameters:

  • fileFullPath (string)
  • fileRelativePath (string)
  • parser (IFrontMatterParser)
  • content (string)

Returns: (FrontMatter, string)

Merge

public FrontMatter Merge(FrontMatter other)

Parameters:

  • other (FrontMatter)

Returns: FrontMatter