Link

The link helper generates links relative to the current page. You pass it an absolute path and it will return a URL relative to the current page with the correct amount of ../ references; it also does the important job of checking links exist at compile time!

Prefer using wiki-style links wherever possible.

info

If you pass a relative path starting with a period or use the http: or https: schemes it will not be modified.

If the current page has set absolute then this helper will render an absolute path.

warn

Relative paths are not verified so should be avoided.

Arguments

Example

Link to a page:

[Contact]({{link "contact"}})

Renders as:

[Contact]../../../../contact/

Link to a resource:

<img src="{{link "assets/svg/menu.svg"}}">

Renders as:

<img src="../../../../assets/svg/menu.svg">

Back to Helpers