Changeset

3336:4af114684e0a

mod_http_index: Allow listed modules to include a friendlier name Example: ``` module:provides("http", { name = "demo"; title = "Demo HTTP Module"; route = { GET = function() return "Hello"; end; }; }); ```
author Kim Alvefur <zash@zash.se>
date Thu, 27 Sep 2018 17:13:10 +0200
parents 3335:04fe2b41da91
children 3337:b46bb9392efe
files mod_http_index/http_index.html mod_http_index/mod_http_index.lua
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_index/http_index.html	Thu Sep 27 16:56:44 2018 +0200
+++ b/mod_http_index/http_index.html	Thu Sep 27 17:13:10 2018 +0200
@@ -33,7 +33,7 @@
 <div class="content">
 <nav>
 <ul>{items#
-<li><a href="{item.url}" title="{item.module}">{item.name}</a></li>}
+<li><a href="{item.url}" title="{item.module}">{item.title?{item.name}}</a></li>}
 </ul>
 </nav>
 </div>
--- a/mod_http_index/mod_http_index.lua	Thu Sep 27 16:56:44 2018 +0200
+++ b/mod_http_index/mod_http_index.lua	Thu Sep 27 17:13:10 2018 +0200
@@ -30,6 +30,7 @@
 	for _, item in ipairs(host_items) do
 		if module.name ~= item._provided_by then
 			table.insert(http_apps, {
+				title = item.title or item.name;
 				name = item.name;
 				module = "mod_" .. item._provided_by;
 				url = relative(canonical, module:http_url(item.name, item.default_path));