File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -355,6 +355,38 @@ Returns the absolute URL (with scheme and host) for the given route. If
355355``schemeRelative `` is enabled, it'll create a scheme-relative URL. More
356356information in :ref: `book-templating-pages `.
357357
358+ absolute_url
359+ ~~~~~~~~~~~~
360+
361+ .. code-block :: jinja
362+
363+ {{ absolute_url(path) }}
364+
365+ ``path ``
366+ **type **: ``string ``
367+
368+ Returns the absolute URL for the given absolute path. This is useful to convert
369+ an existing path:
370+
371+ .. code-block :: jinja
372+
373+ {{ absolute_url(asset(path)) }}
374+
375+ relative_path
376+ ~~~~~~~~~~~~~
377+
378+ .. code-block :: jinja
379+
380+ {{ relative_path(path) }}
381+
382+ ``path ``
383+ **type **: ``string ``
384+
385+ Returns a relative path for the given absolute path (based on the current
386+ request path). For instance, if the current path is
387+ ``/article/news/welcome.html ``, the relative path for ``/article/image.png `` is
388+ ``../images.png ``.
389+
358390expression
359391~~~~~~~~~~
360392
You can’t perform that action at this time.
0 commit comments