chiark / gitweb /
doc: document the format_siteurl Jinja2 filter better.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 2 Nov 2017 19:42:43 +0000 (20:42 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 2 Nov 2017 19:52:51 +0000 (20:52 +0100)
doc/plugins/htmlsanity.rst

index dde2f61d424ac4c62d1b4d25157a070290777e05..3353a60e47e854748d362f5207bb44ae2878b8a9 100644 (file)
@@ -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 <https://docs.python.org/3/library/urllib.parse.html#urllib.parse.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 <https://docs.python.org/3/library/urllib.parse.html#urllib.parse.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