From d0caf24f1b9d1940fb788e5a51515593ddbfc170 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 20:06:24 +0000 Subject: [PATCH] perf: optimize author filtering in terms.html Replace suboptimal filtering inside the loop with Hugo's 'where' function. This allows filtering out the author 'Kartik' before sorting and iterating, which is more efficient as the sorting algorithm operates on a smaller subset of data and the template engine avoids unnecessary iterations and conditional logic. - Use 'where' to filter .Data.Pages by Title - Sort the already filtered collection - Simplify the loop by using the dot context (.) directly Co-authored-by: k4rtik <374340+k4rtik@users.noreply.github.com> --- layouts/authors/terms.html | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/layouts/authors/terms.html b/layouts/authors/terms.html index 50ccceb..9bfb589 100644 --- a/layouts/authors/terms.html +++ b/layouts/authors/terms.html @@ -12,11 +12,9 @@ Sorted alphabetically: