diff --git a/r2/r2/controllers/listingcontroller.py b/r2/r2/controllers/listingcontroller.py
index 91c3467f4..68b3394a4 100644
--- a/r2/r2/controllers/listingcontroller.py
+++ b/r2/r2/controllers/listingcontroller.py
@@ -95,6 +95,7 @@ class ListingController(RedditController):
show_sidebar = self.show_sidebar,
nav_menus = self.menus,
title = self.title(),
+ description = c.site.description,
infotext = self.infotext,
**self.render_params).render()
return res
diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py
index ae539b9c8..584b6c693 100644
--- a/r2/r2/lib/pages/pages.py
+++ b/r2/r2/lib/pages/pages.py
@@ -78,9 +78,12 @@ class Reddit(Wrapped):
def __init__(self, space_compress = True, nav_menus = None, loginbox = True,
infotext = '', content = None, title = '', robots = None,
- show_sidebar = True, **context):
+ canonical = None, description = None, show_sidebar = True,
+ **context):
Wrapped.__init__(self, **context)
self.title = title
+ self.description = description
+ self.canonical = canonical
self.robots = robots
self.infotext = infotext
self.loginbox = True
@@ -432,7 +435,9 @@ class LinkInfoPage(Reddit):
self.link = self.link_listing.things[0]
link_title = ((self.link.title) if hasattr(self.link, 'title') else '')
+ canonical = "%s%s" % (add_sr(self.link.permalink), "?sort=top")
if comment:
+ canonical = "%s%s" % (add_sr(comment.make_permalink_slow()), "?sort=top")
if comment._deleted and not c.user_is_admin:
author = _("[deleted]")
else:
@@ -443,7 +448,7 @@ class LinkInfoPage(Reddit):
else:
params = {'title':_force_unicode(link_title), 'site' : c.site.name}
title = strings.link_info_title % params
- Reddit.__init__(self, title = title, *a, **kw)
+ Reddit.__init__(self, title = title, canonical=canonical, *a, **kw)
def build_toolbars(self):
base_path = "/%s/%s/" % (self.link._id36, title_to_url(self.link.title))
diff --git a/r2/r2/templates/base.html b/r2/r2/templates/base.html
index 360fedcdf..6db2fd37f 100644
--- a/r2/r2/templates/base.html
+++ b/r2/r2/templates/base.html
@@ -33,6 +33,7 @@
+ ${self.Description()}
${self.robots()}
@@ -73,6 +74,9 @@
${title}
%def>
+<%def name="Description()">
+%def>
+
<%def name="keywords()">
reddit, reddit.com, vote, comment, submit
%def>
diff --git a/r2/r2/templates/reddit.html b/r2/r2/templates/reddit.html
index 018d6b836..aec026652 100644
--- a/r2/r2/templates/reddit.html
+++ b/r2/r2/templates/reddit.html
@@ -36,6 +36,12 @@
%endif
%def>
+<%def name="Description()">
+ %if thing.description:
+
+ %endif
+%def>
+
<%def name="stylesheet()">
<% from r2.lib.template_helpers import static, get_domain %>
@@ -73,6 +79,9 @@
%endif
+ %if thing.canonical:
+
+ %endif
%def>
<%def name="javascript()">