# HG changeset patch # User Kim Alvefur # Date 1574004808 -3600 # Node ID 8992f84ca8707b138e18466f3d66358d73c8ab61 # Parent cb9517827d7626e026af3380ea8c1bdecf80075c mod_http_index: Only show http apps that include a title by default This lets http modules indicate whether they make sense to be user-facing or not. diff -r cb9517827d76 -r 8992f84ca870 mod_http_index/README.markdown --- a/mod_http_index/README.markdown Sun Nov 17 16:32:59 2019 +0100 +++ b/mod_http_index/README.markdown Sun Nov 17 16:33:28 2019 +0100 @@ -22,6 +22,15 @@ # Advanced +## Listing all items + +By default only HTTP apps that include a human-readable title are +listed. This filtering can be disabled by setting: + +```lua +http_index_list_all = true +``` + ## Template The template can be customized by copying the included `http_index.html` diff -r cb9517827d76 -r 8992f84ca870 mod_http_index/mod_http_index.lua --- a/mod_http_index/mod_http_index.lua Sun Nov 17 16:32:59 2019 +0100 +++ b/mod_http_index/mod_http_index.lua Sun Nov 17 16:33:28 2019 +0100 @@ -3,6 +3,8 @@ module:depends"http"; +local show_all = module:get_option_boolean(module.name .. "_show_all", true); + local base_template; do local template_file = module:get_option_string(module.name .. "_template", module.name .. ".html"); @@ -28,7 +30,7 @@ local host_items = module:get_host_items("http-provider"); local http_apps = {} for _, item in ipairs(host_items) do - if module.name ~= item._provided_by then + if module.name ~= item._provided_by and (show_all or item.title) then table.insert(http_apps, { title = item.title or item.name; name = item.name;