The :::include block inlines content from a local file or remote URL
directly into the page at render time. The included content is processed
through the full pipeline and baked into the cached page.
::: include
path/to/file.md
:::
The optional ttl=N modifier sets the parent page cache TTL in seconds
if no ttl: is set in the page front matter. Useful for pages that include
frequently updated remote content.
/ - absolute from docroothttp:// or https:// - remote URL fetch.md file directory.md filestitle and layout front matter are ignored - only the body
is used.
.sh, .pl, .py, .yml, .json, .css etc.).html files<pre> with HTML entities escaped.
Include a local Markdown partial:
::: include
partials/shared-note.md
:::
Include a remote file, refresh every 5 minutes:
::: include ttl=300
https://raw.githubusercontent.com/owner/repo/main/CHANGELOG.md
:::
Include a code file (renders as a syntax-highlighted code block):
::: include
/examples/config-sample.yml
:::
If a local file is missing or a remote fetch fails, the block renders
as a silent span with class include-error and a data-src attribute
recording the failed source path. A warning is written to the error log.
Expose errors during development:
.include-error::before {
content: "include failed: " attr(data-src);
color: red;
display: block;
}
:::include inside an included .md
file is not processed. This prevents infinite loops.ttl=N modifier only sets the TTL if no ttl: key is present in
the page front matter. Front matter always takes priority.ttl: in front
matter or the ttl=N modifier.