File tree 1 file changed +32
-0
lines changed
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
355
355
``schemeRelative `` is enabled, it'll create a scheme-relative URL. More
356
356
information in :ref: `book-templating-pages `.
357
357
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
+
358
390
expression
359
391
~~~~~~~~~~
360
392
You can’t perform that action at this time.
0 commit comments