diff options
| author | Volpeon <git@volpeon.ink> | 2021-11-11 13:34:13 +0100 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2021-11-11 13:34:13 +0100 |
| commit | e9a69b140a9aa44223c40d56aa738479131600fd (patch) | |
| tree | d2796e5c5b53a83f030b95c5e61bf69e63bb0fc1 /scripts | |
| parent | Body: Don't make bg white (diff) | |
| download | volpeon.ink-e9a69b140a9aa44223c40d56aa738479131600fd.tar.gz volpeon.ink-e9a69b140a9aa44223c40d56aa738479131600fd.tar.bz2 volpeon.ink-e9a69b140a9aa44223c40d56aa738479131600fd.zip | |
Fixes
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/metadata_filter.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/metadata_filter.lua b/scripts/metadata_filter.lua index 3bea687..daad940 100644 --- a/scripts/metadata_filter.lua +++ b/scripts/metadata_filter.lua | |||
| @@ -89,18 +89,17 @@ end | |||
| 89 | 89 | ||
| 90 | function prep_menu(active_id, main_menu) | 90 | function prep_menu(active_id, main_menu) |
| 91 | local active_item = nil | 91 | local active_item = nil |
| 92 | local items = pandoc.List() | ||
| 92 | 93 | ||
| 93 | for i = 1, #main_menu do | 94 | for i = 1, #main_menu do |
| 94 | local item = main_menu[i] | 95 | local item = main_menu[i] |
| 95 | local active = pandoc.utils.stringify(item.id) == active_id | 96 | local active = pandoc.utils.stringify(item.id) == active_id |
| 96 | item.active = active | 97 | item.active = active |
| 97 | if active then active_item = item end | 98 | if active then active_item = item end |
| 99 | if not item.hidden or item.active then items:insert(item) end | ||
| 98 | end | 100 | end |
| 99 | 101 | ||
| 100 | return { | 102 | return { items = items, active = active_item } |
| 101 | items = main_menu:filter(function(item) return not item.hidden or item.active end), | ||
| 102 | active = active_item, | ||
| 103 | } | ||
| 104 | end | 103 | end |
| 105 | 104 | ||
| 106 | function process_pages(global, pages_by_id) | 105 | function process_pages(global, pages_by_id) |
