From d706f357e4227c08b5c7bf510f61e1d37cabeaa4 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 25 Sep 2023 22:56:26 +0100 Subject: [PATCH] Use `max` to efficiently get latest list item --- theme/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/main.html b/theme/main.html index 65bf142..a5d42b4 100644 --- a/theme/main.html +++ b/theme/main.html @@ -23,4 +23,4 @@ Globals: {{ globals.foo }} Static path: {% static "assets/pygments.css" %} SRI: {% sri_integrity "assets/pygments.css" %} -"Latest" list: {{ get_page("list/index.md")|children|sort(attribute="title")|first }} +"Latest" list: {{ get_page("list/index.md")|children|max(attribute="title") }}