From b4444941222ce6d12613c9e97ad64b7a345ff3c8 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 16 Jun 2022 10:05:59 +0200 Subject: Update --- scripts/metadata_filter.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index 07f060c..b78c480 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua @@ -51,9 +51,9 @@ function page_sort(order) elseif p2.position then return false elseif order == "date_desc" then - if p1.date then - if p2.date then - return p1.date.yyyy_mm_dd > p2.date.yyyy_mm_dd + if p1.last_update then + if p2.last_update then + return p1.last_update.yyyy_mm_dd > p2.last_update.yyyy_mm_dd else return true end @@ -155,7 +155,7 @@ function process_pages(global, order, pages_by_id) local p = process(global, page) if not p.unlisted then pages_all:insert(p) - if p.date then pages_date_desc:insert(p) end + if p.last_update then pages_date_desc:insert(p) end end end @@ -188,6 +188,7 @@ function d1_page_to_list_item(meta, p) title = p.title, subtitle = p.subtitle, date = p.date, + last_update = p.last_update, position = p.position, url = p.url, slug = p.slug, @@ -204,6 +205,7 @@ function d2_page_to_list_item(meta, cat, p, set_cat_title) subtitle = p.subtitle, category = set_cat_title and cat.title, date = p.date, + last_update = p.last_update, position = p.position, url = p.url, slug = p.slug, @@ -223,6 +225,7 @@ function cat_to_list_cat(cat, allItems) title = cat.title, description = (cat.description and pandoc.MetaBlocks(pandoc.Para(cat.description))) or (not cat.no_description and cat.content), + last_update = cat.last_update, url = cat.url, slug = cat.slug, layout = cat.list_layout, -- cgit v1.2.3-70-g09d2