diff options
| author | Dennis Fink | 2026-11-04 18:41:23 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-04 18:41:23 +0100 |
| commit | e7e365c239f766a8d2271c233f16c4df53a9bbb3 (patch) | |
| tree | 3fe4b543aee8f16fb42204d666ca2a17a268c1ac /templates/blog-post.html | |
| parent | 7b234437e57f75befdec8eaa177bb541654c72a5 (diff) | |
| download | dennisfink.me-e7e365c239f766a8d2271c233f16c4df53a9bbb3.tar.gz dennisfink.me-e7e365c239f766a8d2271c233f16c4df53a9bbb3.zip | |
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.
Diffstat (limited to '')
| -rw-r--r-- | templates/blog-post.html | 12 |
1 files changed, 9 insertions, 3 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 @@ <meta property="article:author" content="https://dennisfink.me/about"> {% if this.publication_date %} <meta property="article:published_time" - content="{{ this.publication_date }}T00:00:00+02:00"> + content="{{ this.publication_date }}T00:00:00+02:00" + data-pagefind-meta="date[content]" + data-pagefind-sort="date[content]"> {% endif %} {% if latest_change %} <meta property="article:modified_time" @@ -29,10 +31,14 @@ {% endif %} {% if this.category %} {% set category = site.get("/categories/" + this.category) %} - <meta property="article:section" content="{{ category.name }}"> + <meta property="article:section" + content="{{ category.name }}" + data-pagefind-filter="category[content]"> {% endif %} {% for t in this.tags %} - <meta property="article:tag" content="{{ t }}"> + <meta property="article:tag" + content="{{ t }}" + data-pagefind-filter="tag[content]"> {% endfor %} {% endblock %} |
