Centra includes a few quality of life variables which makes it easier to do certain things.
$rel() lets you reference files relative to the current content file without hard-coding absolute URLs.
Centra resolves this variable server-side before sending content to the client.
Without $rel (hard-coded URL):
With $rel:
)Centra will replace this with the correct absolute URL automatically.
For $rel() to work, CENTRA_PUBLIC_URL must be set:
CENTRA_PUBLIC_URL=https://cms.centra.exampleThis value is used as the base URL when resolving relative paths.
- Paths are resolved relative to CONTENT_ROOT directory
- Works only in YAML and Markdown files