From e7e365c239f766a8d2271c233f16c4df53a9bbb3 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 4 Nov 2026 18:41:23 +0100 Subject: Improve Pagefind indexing and filtering This adds publication dates, categories, and tags to Pagefind metadata, enabling search results to be sorted by date and filtered by category or tag. It also excludes tables of contents, post metadata, and footer sections from search indexing to keep results focused on the actual article content. --- templates/blog-post.html | 12 +++++++++--- templates/macros/blog.html | 12 +++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/templates/blog-post.html b/templates/blog-post.html index 3bde48d..4f1e5a2 100644 --- a/templates/blog-post.html +++ b/templates/blog-post.html @@ -21,7 +21,9 @@ {% if this.publication_date %} + content="{{ this.publication_date }}T00:00:00+02:00" + data-pagefind-meta="date[content]" + data-pagefind-sort="date[content]"> {% endif %} {% if latest_change %} + {% endif %} {% for t in this.tags %} - + {% endfor %} {% endblock %} diff --git a/templates/macros/blog.html b/templates/macros/blog.html index c3b5390..09e6a65 100644 --- a/templates/macros/blog.html +++ b/templates/macros/blog.html @@ -1,7 +1,7 @@ {% from "macros/pagination.html" import render_pagination %} {% macro render_toc(toc, maxdepth=2) %} - + Table of contents {% for item in toc recursive %} @@ -37,7 +37,7 @@ {{ post.title }} - + {% if post.publication_date %} Posted: @@ -86,7 +86,7 @@ {{ post.body }}
Table of contents