From 8261feb5654a940038e4ffce31409bfe43490360 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 2 Nov 2017 20:42:43 +0100 Subject: [PATCH] doc: document the format_siteurl Jinja2 filter better. --- doc/plugins/htmlsanity.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/plugins/htmlsanity.rst b/doc/plugins/htmlsanity.rst index dde2f61d..3353a60e 100644 --- a/doc/plugins/htmlsanity.rst +++ b/doc/plugins/htmlsanity.rst @@ -286,8 +286,14 @@ making use of both fields could look like this: --------------------- Convenience filter replacing the common expression :jinja:`{{ SITEURL }}/{{ page.url }}` -with a formatter that makes use of `urljoin `_ so it does the right thing also when -dealing with absolute URLs and even when they start with just ``//``: +with a formatter that makes use of `urljoin `_ +so it does the right thing also when dealing with absolute URLs and even when +they start with just ``//``. + +For example, if :py:`SITEURL` is :py:`'http://your.site'` and you apply +``format_siteurl`` to :py:`'about/'`, then you get ``http://your.site/about/``; +but if you apply it to :py:`'https://github.com/mosra/m.css'`, then you get +just ``https://github.com/mosra/m.css``. .. code:: jinja -- 2.30.2