🖨️Include
With the include
directive you can include the contents of another file inside your template. The contents of the included file will be treated as if the contents of that file were written in place of its include
directive.
You can only write include
directives where you could also write HTML. This means, include
directives are not allowed in the following contexts:
Before the
func
directive in main filesInside the body of a mixin call, if not inside one of the mixins
block
s
Depending on the included file's file extension, corgi will treat included files differently:
.corgi
: The file will be treated as corgi code, and will be parsed by the parser..html
,.js
, or.css
: The file will be minified and included in the output.Any other file will be escaped using
woof.EscapeHTMLBody
and written to the output.
If you don't want the behavior described above, but cannot/don't want to change the file's extension, consider using cat
as a filter:
Included .corgi
-files may also import
and use
other files.
Last updated