Until now, the link replacing worked only on article and page
contents or summaries. With this patch, if one needes to replace
links in custom fields, there are two new Jinja2 filters that can do
that. For fields that are referenced in the `FORMATTED_FIELDS` setting,
one can use the `expand_links` Jinja2 filter in the template, passing
the field name as a parameter:
{{ article|expand_links('legal') }}
If the custom field consists of just one link (for example a link to
article cover image for a social meta tag), one can use the
`expand_link` Jinja2 filter:
{{ article|expand_link('cover') }}
With the above being in a template and `FORMATTED_FIELDS` setting
containing the `'legal'` field, a RST article making use of both fields
could look like this:
An article
##########
📅 2017-06-22
:legal: This article is released under `CC0 {filename}/license.rst`.
:cover: {filename}/img/article-cover.jpg
The Typogrify library is no longer actively maintained by the
original author. These changes switch Pelican over to a new fork that
will receive more consistent updates going forward.
publication time and date and the last modified time and date
independently.
This makes it possible to access the last updated date with {{ article.locale_modified }} in templates.
Additionally, an already delivered feed entry can be corrected by changing the modified date and time, as it is used for atom:update
/ rss pubDate field now.
1. Escape `|tag|` and `|category|` with double ticks otherwise reST converts them to links that are invalid.
2. Updated syntax for relative links use braces instead of bars.
I have added reference to "Linking to internal content" section because
without it, it is difficult to explain the usage.
I have also updated changelog.
Closesgetpelican/pelican#1061