Include(path, [template])
Include a file or template into another page.
include2 is an internal variant used while rendering included documents — do not call it yourself.
Parameters
pathstringrequiredAbsolute path of file to include.
templatestringoptionalIf referring to a Docly document with a schema that include templates.
You can specify what template it should generate.
Returns
The file's content — for a file with #JS code, the executed result. With a template, the document generated through that template, or the generator's error message if generation fails.
If the file is not found, the text Unknown file <path> is returned (no error is thrown). A file that includes itself, directly or through other files, is stopped with the text Infinite include loop stopped for …. The same file can still be included several times on one page.
Example
<html>
<head>
<title>Test</title>
</head>
<body>
#include("#/Test-header.html")#
<article>
Content here ...
#include("Frontpage", "Article.html")#
</article>
#include("#/Test-footer.html")#
</body>
</html><html>
<head>
<title>Test</title>
</head>
<body>
This is content placed in the file Test-header.html.
<article>
Content here ...
Unknown file Frontpage
</article>
Test-footer.html file contents.
</body>
</html>