From 3a51b633a07dfa86b43c43a9da2a08dfe276094a Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Mon, 13 Oct 2025 09:34:57 -0400 Subject: [PATCH] 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 }} --- pelicanconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelicanconf.py b/pelicanconf.py index 2ce727e..48a2072 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -106,7 +106,7 @@ OUTPUT_SOURCES_EXTENSION = '.rst' # Setup filters and plugins. PLUGIN_PATHS = ["pelican-plugins"] -PLUGINS = ["random_article"] +PLUGINS = ["random_article", "strip_toc_summary"] # register filters. # JINJA_FILTERS = {'linkpeek':linkpeek}