Please welcome pageLink, a lovely macro for outputting a link to a page in a consistent, feature-ful and correct fashion.

Usage:

{{ pageLink(page, { options... }) }}

Outputs a simple anchor tag pointing to a page. The anchor tag gets the apos-page-link class.

The title is correctly escaped.

If the page is unpublished, the apos-unpublished class is added to the link.

If options.url is set, it is used instead of the page URL.

If options.void is set, javascript:void(0) is used as the URL.

If options.class is set, it is applied to the anchor element.