Skip to content

Testfile for macros

Since v40 (dd 20260511 22) zensical has support for macros.

See https://zensical.org/docs/setup/extensions/macros/

replace a variable

the zensical.toml contains following lines:

[project.markdown_extensions.zensical.extensions.macros]
on_error_fail = true
on_undefined = "strict"
include_yaml = ["variables.yml"]

the variables.yml contains the variable,
this file is in the root of this zensical project
i.e. in the zdocs dir (the dir where the zensical.toml is)

computer: "name of a computer"

a computer such as: name of a computer.

a computer such as: {{ computer }}.

Now it is 2026-05-05 10:44:35.865172, now means at time this file was build

Now it is {{ now() }}
two_days_ago -> {% now 'utc' - 'days=2', '%Y-%m-%dT%H:%M:%SZ' %}

now('%Y-%m-%dT%H:%M:%SZ' ... seems not to work


set a variable and display it

{% set x = 42 %}
{{ x }}

Here you see the variable: - 42 -

git variables

Committed on 2026-05-05 12:44:10+02:00 by Oa8choo2, build on 2026-05-05 10:44:35.865194