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.
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.
Statiq Web attempts to extract an excerpt and headings from your content and stores them in metadata.
Statiq Web provides a number of ways to link to documents.
Statiq can generate redirects for your content if it changes location.
Statiq Web can locally mirror remote resources such as scripts and stylesheet links.
Shortcodes are small but powerful macros that can generate content or add metadata to your documents.