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 @@ -358,6 +358,38 @@ Returns the absolute URL (with scheme and host) for the given route. If
358
358
``schemeRelative `` is enabled, it'll create a scheme-relative URL. More
359
359
information in :ref: `book-templating-pages `.
360
360
361
+ absolute_url
362
+ ~~~~~~~~~~~~
363
+
364
+ .. code-block :: jinja
365
+
366
+ {{ absolute_url(path) }}
367
+
368
+ ``path ``
369
+ **type **: ``string ``
370
+
371
+ Returns the absolute URL for the given absolute path. This is useful to convert
372
+ an existing path:
373
+
374
+ .. code-block :: jinja
375
+
376
+ {{ absolute_url(asset(path)) }}
377
+
378
+ relative_path
379
+ ~~~~~~~~~~~~~
380
+
381
+ .. code-block :: jinja
382
+
383
+ {{ relative_path(path) }}
384
+
385
+ ``path ``
386
+ **type **: ``string ``
387
+
388
+ Returns a relative path for the given absolute path (based on the current
389
+ request path). For instance, if the current path is
390
+ ``/article/news/welcome.html ``, the relative path for ``/article/image.png `` is
391
+ ``../images.png ``.
392
+
361
393
expression
362
394
~~~~~~~~~~
363
395
You can’t perform that action at this time.
0 commit comments