Path

Prepend a URL/string with the current site root.


Usage

This tag will ensure that the site root is prepended to the beginning of a string. It’s especially useful when running in a subdirectory.

The site root is defined in system.yaml’s locales array in the url value for your locale. For example:

locales:
  en:
    url: /

Assuming site root is /:

{{ path src="contact" }}
{{ path src="contact" absolute="true" }}
/contact
http://example.com/contact

Assuming site root is /subdirectory/:

{{ path src="contact" }}
{{ path src="contact" absolute="true" }}
/subdirectory/contact
http://example.com/subdirectory/contact

Assuming site root is http://example.com/:

{{ path src="contact" }}
{{ path src="contact" absolute="true" }}
http://example.com/contact
http://example.com/contact

Parameters

src

string

The path to append to the site root.

absolute

boolean false

Make the URL absolute if it isn't already.

Last modified on October 18, 2017