`Internal link expansion`_
--------------------------
-By default, link expansion works only in document content and article
-summaries. In order to expand links in additional fields and arbitrary strings,
-this plugin provides two Jinja2 filters, producing results equivalent to
+By default, link expansion works only in document content and fields that are
+referenced in the :py:`FORMATTED_FIELDS` (such as article summaries). In order
+to expand links in additional fields and arbitrary strings, this plugin
+provides two Jinja2 filters, producing results equivalent to
`links expanded by Pelican <http://docs.getpelican.com/en/stable/content.html#linking-to-internal-content>`_.
-For fields that are referenced in the :py:`FORMATTED_FIELDS` setting, one can
-use the ``expand_links`` Jinja2 filter in the template. The link expansion
-needs the content object (either ``article`` or ``page``) as a parameter.
+For formatted fields, one can use the ``expand_links`` Jinja2 filter in the
+template. The link expansion needs the content object (either ``article`` or
+``page``) as a parameter.
.. code:: jinja
link)
def expand_links(text, content):
+ # TODO: fields that are in FORMATTED_FIELDS are already expanded, but that
+ # requires extra work on user side. Ideal would be to handle that all on
+ # template side, so keeping this one for the time when we can replace
+ # FORMATTED_FIELDS with render_rst as well.
return content._update_content(text, content.get_siteurl())
# To be consistent with both what Pelican does now with '/'.join(SITEURL, url)