# HG changeset patch # User Kim Alvefur # Date 1441319026 -7200 # Node ID 9376e870f0e18889c7985c2f40d5ce2cf4b1485e # Parent ae2235d6c3f882963d0e2de35d705eb4beeca554 mod_http_index: Move template out into a file and make it configurable diff -r ae2235d6c3f8 -r 9376e870f0e1 mod_http_index/http_index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_http_index/http_index.html Fri Sep 04 00:23:46 2015 +0200 @@ -0,0 +1,46 @@ + + + + + + + +{title} + + + +
+

HTTP Apps

+
+
+
+ +
+
+ + + diff -r ae2235d6c3f8 -r 9376e870f0e1 mod_http_index/mod_http_index.lua --- a/mod_http_index/mod_http_index.lua Fri Sep 04 00:12:13 2015 +0200 +++ b/mod_http_index/mod_http_index.lua Fri Sep 04 00:23:46 2015 +0200 @@ -3,55 +3,13 @@ module:depends"http"; --- TODO Move templates into files -local base_template = [[ - - - - - - - -{title} - - - -
-

{title}

-
-
-
- -
-
- - - -]]; +local base_template; +do + local template_file = module:get_option_string(module.name .. "_template", module.name .. ".html"); + template_file = assert(module:load_resource(template_file)); + base_template = template_file:read("*a"); + template_file:close(); +end local canonical = module:http_url(nil, "/");