Diff

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
parent 1558:4e5d307c96d2
child 1560:6c6c1fab4ee5
line wrap: on
line diff
--- a/mod_http_muc_log/mod_http_muc_log.lua	Sun Nov 09 08:47:41 2014 +0100
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Sun Nov 09 17:14:44 2014 +0100
@@ -57,6 +57,7 @@
 <html>
 <head>
 <meta charset="utf-8">
+<link rel="canonical" href="{canonical}">
 <title>{title}</title>
 <style>
 body{background-color:#eeeeec;margin:1ex 0;padding-bottom:3em;font-family:Arial,Helvetica,sans-serif;}
@@ -218,6 +219,8 @@
 	until not next_day;
 
 	return dates_template{
+		host = module.host;
+		canonical = module:http_url() .. "/" .. path;
 		room = room;
 		lines = table.concat(dates);
 	};
@@ -291,6 +294,8 @@
 	end
 
 	return page_template{
+		canonical = module:http_url() .. "/" .. path;
+		host = module.host;
 		room = room;
 		date = date;
 		logs = table.concat(logs);
@@ -313,6 +318,7 @@
 	end
 	return room_list_template {
 		host = module.host;
+		canonical = module:http_url() .. "/";
 		rooms = table.concat(room_list);
 	};
 end