Add strip_anchors Jinja2 filter plugin for article summaries
This plugin strips TOC divs and toc-backref anchor links from article
summaries when displayed on the homepage. This prevents broken anchor
links in homepage excerpts that would point to non-existent IDs.
The filter is applied in the theme's index.html template via:
{{ article.summary | strip_anchors }}
This commit is contained in:
parent
d2f5de70da
commit
3a51b633a0
1 changed files with 1 additions and 1 deletions
|
|
@ -106,7 +106,7 @@ OUTPUT_SOURCES_EXTENSION = '.rst'
|
||||||
# Setup filters and plugins.
|
# Setup filters and plugins.
|
||||||
|
|
||||||
PLUGIN_PATHS = ["pelican-plugins"]
|
PLUGIN_PATHS = ["pelican-plugins"]
|
||||||
PLUGINS = ["random_article"]
|
PLUGINS = ["random_article", "strip_toc_summary"]
|
||||||
|
|
||||||
# register filters.
|
# register filters.
|
||||||
# JINJA_FILTERS = {'linkpeek':linkpeek}
|
# JINJA_FILTERS = {'linkpeek':linkpeek}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue