Mercurial > prosody-modules
comparison mod_http_index/mod_http_index.lua @ 5967:28b386fc7a05
mod_http_index: Add metadata to enable installation with plugin installer
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 08 Oct 2024 22:17:01 +0200 |
| parents | ba4f45b8678f |
| children | a1aa56ebe73f |
comparison
equal
deleted
inserted
replaced
| 5966:1bb8b559f441 | 5967:28b386fc7a05 |
|---|---|
| 5 | 5 |
| 6 local show_all = module:get_option_boolean(module.name .. "_show_all", false); | 6 local show_all = module:get_option_boolean(module.name .. "_show_all", false); |
| 7 | 7 |
| 8 local base_template; | 8 local base_template; |
| 9 do | 9 do |
| 10 local template_file = module:get_option_string(module.name .. "_template", module.name .. ".html"); | 10 local template_file = module:get_option_path(module.name .. "_template", module.name .. ".html", "html"); |
| 11 template_file = assert(module:load_resource(template_file)); | 11 template_file = assert(io.open(template_file)); |
| 12 base_template = template_file:read("*a"); | 12 base_template = template_file:read("*a"); |
| 13 template_file:close(); | 13 template_file:close(); |
| 14 end | 14 end |
| 15 | 15 |
| 16 local canonical = module:http_url(nil, "/"); | 16 local canonical = module:http_url(nil, "/"); |
