Dynamic Variables
Portosaurus allows you to use placeholders in your config.yaml or markdown files that are resolved at build time.
Syntax
Use double curly braces to reference a variable: {{variable_name}}.
Available Variables
System Variables
4.0.1: Current Portosaurus version.{{portoRoot}}: Absolute path to the Portosaurus installation root. Crucial for referencing internal assets.2026: Year at build time.April 23, 2026: Date at build time.
Configuration References
You can reference values from the site block within other parts of your configuration:
{{site.title}}: Site title from the site block.{{site.tagline}}: Site tagline from the site block.{{site.url}}: Site URL from the site block.
Environment Variables
Access any system environment variable using the env: prefix:
yaml
footer_text: "Built with love on {{env:HOSTNAME}}"Custom Variables
You can define your own variables in the custom: block of your config.yaml and reference them elsewhere:
yaml
custom:
twitter_handle: "@myname"
hero_section:
desc: "Follow me on Twitter: {{custom.twitter_handle}}"Literals & Escaping
If you want to display the literal {{variable_name}} without it being resolved, prefix the first brace with a backslash: {{variable_name}}.