comparison mod_http_muc_log/mod_http_muc_log.lua @ 1559:96f11a1c8b37

mod_http_muc_log: Include the canonical URL in a meta tag
author Kim Alvefur <zash@zash.se>
date Sun, 09 Nov 2014 17:14:44 +0100
parents 4e5d307c96d2
children 6c6c1fab4ee5
comparison
equal deleted inserted replaced
1558:4e5d307c96d2 1559:96f11a1c8b37
55 local base = template(template[[ 55 local base = template(template[[
56 <!DOCTYPE html> 56 <!DOCTYPE html>
57 <html> 57 <html>
58 <head> 58 <head>
59 <meta charset="utf-8"> 59 <meta charset="utf-8">
60 <link rel="canonical" href="{canonical}">
60 <title>{title}</title> 61 <title>{title}</title>
61 <style> 62 <style>
62 body{background-color:#eeeeec;margin:1ex 0;padding-bottom:3em;font-family:Arial,Helvetica,sans-serif;} 63 body{background-color:#eeeeec;margin:1ex 0;padding-bottom:3em;font-family:Arial,Helvetica,sans-serif;}
63 header,footer{margin:1ex 1em;} 64 header,footer{margin:1ex 1em;}
64 footer{font-size:smaller;color:#babdb6;} 65 footer{font-size:smaller;color:#babdb6;}
216 break; 217 break;
217 end 218 end
218 until not next_day; 219 until not next_day;
219 220
220 return dates_template{ 221 return dates_template{
222 host = module.host;
223 canonical = module:http_url() .. "/" .. path;
221 room = room; 224 room = room;
222 lines = table.concat(dates); 225 lines = table.concat(dates);
223 }; 226 };
224 end 227 end
225 228
289 module:log("debug", "Previous message: %s", datetime.datetime(when)); 292 module:log("debug", "Previous message: %s", datetime.datetime(when));
290 break; 293 break;
291 end 294 end
292 295
293 return page_template{ 296 return page_template{
297 canonical = module:http_url() .. "/" .. path;
298 host = module.host;
294 room = room; 299 room = room;
295 date = date; 300 date = date;
296 logs = table.concat(logs); 301 logs = table.concat(logs);
297 next = datetime.date(next_when); 302 next = datetime.date(next_when);
298 prev = datetime.date(prev_when); 303 prev = datetime.date(prev_when);
311 }, i + 1; 316 }, i + 1;
312 end 317 end
313 end 318 end
314 return room_list_template { 319 return room_list_template {
315 host = module.host; 320 host = module.host;
321 canonical = module:http_url() .. "/";
316 rooms = table.concat(room_list); 322 rooms = table.concat(room_list);
317 }; 323 };
318 end 324 end
319 325
320 local cache = setmetatable({}, {__mode = 'v'}); 326 local cache = setmetatable({}, {__mode = 'v'});