statiqdev / Statiq.Web

Statiq Web is a flexible static site generator written in .NET.
https://statiq.dev/web
Other
1.64k stars 234 forks source link

Add a media type and extension/template that can be used as passthrough #967

Closed daveaglick closed 2 years ago

daveaglick commented 2 years ago

Sometimes we've got files that we want to process as content including processing front matter, but we don't want to actually render anything in the body. There's currently no good way to handle this. Add a .statiq extension and corresponding media type and template.

Basically we want to be able to pass this check for files that don't need to be rendered by an actual template: image

It's assumed that most files with a .statiq extension would also have a DestinationPath set since we likely don't actually want to output the .statiq extension. Perhaps .statiq extensions should even be removed by default (I.e. foo.txt.statiq would get an automatic output path of foo.txt and foo.statiq would become foo). Make sure to document this.

Also see if we can't modify the default InputFiles globbing pattern to include underscore files with a .statiq extension. That way, a file like _redirects.statiq would automatically be included, get processed, and output to _redirects.

These files should default to ContentType.Asset unless an alternate ContentType is specified in front matter.