W D Content Files

Content files contain the pages of your site and are processed based on their media type (which is determined by file extension).

The following extensions are recognized by default:

  • .html processes the file as plain HTML.
  • .md processes the file as Markdown.
  • .cshtml processes the file as Razor.

In all cases, global processing (such as processing front matter and applying shortcodes) is performed and layouts and themes are applied.

Many themes treat content differently depending on what sub-folder the files are in. For example, themes for blogging often infer blog posts should go in a "input/posts" sub-folder. In most cases the specific paths used for different types of content are configurable as settings.

Accessing Content Files

Content files are processed by the Content pipeline and can be accessed through the Outputs property of the execution context (which is also available directly in some templating languages like Razor as an Outputs property).

For example, the following code will find all content documents that describe different fruits stored in a food/fruit folder under the default input folder:

IDocument[] fruits = Outputs
  .FromPipeline("Content")
  .FilterSources("food/fruit/*")
  .ToArray();

Preventing Content File Output

By default content files are output to their destination path. You may want to adjust this behavior for individual content files or entire directories. This behavior can be controlled with the ShouldOutput metadata and there are a few ways to set it:

  • Set ShouldOutput to false directly in the data file which will prevent that file from being output.
  • Set ShouldOutput to false for an individual file, and entire directory, or an entire directory tree in a directory metadata file.
  • Set ShouldOutput to false in a sidecar file.
  • Set ShouldOutput to false in front matter.

Preventing content file output can be helpful when you want to define partial content (like product descriptions, personal biographies, etc.) for inclusion in other documents without resulting in an output file.

Child Pages

Excerpts And Headings W D

Statiq Web attempts to extract an excerpt and headings from your content and stores them in metadata.

Links And Cross References W D

Statiq Web provides a number of ways to link to documents.

Redirects W D

Statiq can generate redirects for your content if it changes location.

Resource Mirroring W D

Statiq Web can locally mirror remote resources such as scripts and stylesheet links.