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:
.htmlprocesses the file as plain HTML.
.mdprocesses the file as Markdown.
.cshtmlprocesses 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
For example, the following code will find all content documents that describe different fruits stored in a
food/fruit folder under the default
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:
falsedirectly in the data file which will prevent that file from being output.
falsefor an individual file, and entire directory, or an entire directory tree in a directory metadata file.
falsein a sidecar file.
falsein 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.
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.