Test if the given URL is a url for the current site.

If the current site handles requests for the hostname, then all of the following expressions will echo true:

{{ ""|is_site_url }}
{{ "#foo"|is_site_url }}
{{ "/page/path"|is_site_url }}
{{ "//"|is_site_url }}

The following will echo false:

{{ "https://foo.test"|is_site_url }}
{{ ""|is_site_url }}
{{ "//foo.test"|is_site_url }}

Edit on GitHub

URLs and links url

Referred by


Filters transform template variables before they are rendered.