diff options
| author | Volpeon <git@volpeon.ink> | 2022-06-16 10:05:59 +0200 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2022-06-16 10:05:59 +0200 |
| commit | b4444941222ce6d12613c9e97ad64b7a345ff3c8 (patch) | |
| tree | 167005a56956b2643bda3cf477bcbca868683b19 /scripts/metadata_filter.lua | |
| parent | Update (diff) | |
| download | volpeon.ink-b4444941222ce6d12613c9e97ad64b7a345ff3c8.tar.gz volpeon.ink-b4444941222ce6d12613c9e97ad64b7a345ff3c8.tar.bz2 volpeon.ink-b4444941222ce6d12613c9e97ad64b7a345ff3c8.zip | |
Update
Diffstat (limited to 'scripts/metadata_filter.lua')
| -rw-r--r-- | scripts/metadata_filter.lua | 11 |
1 files changed, 7 insertions, 4 deletions
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) | |||
| 51 | elseif p2.position then | 51 | elseif p2.position then |
| 52 | return false | 52 | return false |
| 53 | elseif order == "date_desc" then | 53 | elseif order == "date_desc" then |
| 54 | if p1.date then | 54 | if p1.last_update then |
| 55 | if p2.date then | 55 | if p2.last_update then |
| 56 | return p1.date.yyyy_mm_dd > p2.date.yyyy_mm_dd | 56 | return p1.last_update.yyyy_mm_dd > p2.last_update.yyyy_mm_dd |
| 57 | else | 57 | else |
| 58 | return true | 58 | return true |
| 59 | end | 59 | end |
| @@ -155,7 +155,7 @@ function process_pages(global, order, pages_by_id) | |||
| 155 | local p = process(global, page) | 155 | local p = process(global, page) |
| 156 | if not p.unlisted then | 156 | if not p.unlisted then |
| 157 | pages_all:insert(p) | 157 | pages_all:insert(p) |
| 158 | if p.date then pages_date_desc:insert(p) end | 158 | if p.last_update then pages_date_desc:insert(p) end |
| 159 | end | 159 | end |
| 160 | end | 160 | end |
| 161 | 161 | ||
| @@ -188,6 +188,7 @@ function d1_page_to_list_item(meta, p) | |||
| 188 | title = p.title, | 188 | title = p.title, |
| 189 | subtitle = p.subtitle, | 189 | subtitle = p.subtitle, |
| 190 | date = p.date, | 190 | date = p.date, |
| 191 | last_update = p.last_update, | ||
| 191 | position = p.position, | 192 | position = p.position, |
| 192 | url = p.url, | 193 | url = p.url, |
| 193 | slug = p.slug, | 194 | slug = p.slug, |
| @@ -204,6 +205,7 @@ function d2_page_to_list_item(meta, cat, p, set_cat_title) | |||
| 204 | subtitle = p.subtitle, | 205 | subtitle = p.subtitle, |
| 205 | category = set_cat_title and cat.title, | 206 | category = set_cat_title and cat.title, |
| 206 | date = p.date, | 207 | date = p.date, |
| 208 | last_update = p.last_update, | ||
| 207 | position = p.position, | 209 | position = p.position, |
| 208 | url = p.url, | 210 | url = p.url, |
| 209 | slug = p.slug, | 211 | slug = p.slug, |
| @@ -223,6 +225,7 @@ function cat_to_list_cat(cat, allItems) | |||
| 223 | title = cat.title, | 225 | title = cat.title, |
| 224 | description = (cat.description and pandoc.MetaBlocks(pandoc.Para(cat.description))) or | 226 | description = (cat.description and pandoc.MetaBlocks(pandoc.Para(cat.description))) or |
| 225 | (not cat.no_description and cat.content), | 227 | (not cat.no_description and cat.content), |
| 228 | last_update = cat.last_update, | ||
| 226 | url = cat.url, | 229 | url = cat.url, |
| 227 | slug = cat.slug, | 230 | slug = cat.slug, |
| 228 | layout = cat.list_layout, | 231 | layout = cat.list_layout, |
