Add canonical shorturls to the header.

This commit is contained in:
James Socol
2011-05-16 17:46:35 -07:00
committed by Max Goodman
parent 2db04c9085
commit 2566c0c13e
3 changed files with 10 additions and 0 deletions

View File

@@ -797,6 +797,9 @@ class LinkInfoPage(Reddit):
self.subtitle = subtitle
if self.link.shortlink:
self.shortlink = self.link.shortlink
# if we're already looking at the 'duplicates' page, we can
# avoid doing this lookup twice
if duplicates is None:

View File

@@ -31,6 +31,9 @@
<link rel="apple-touch-startup-image"
href="/static/compact/reddit_startimg.png" />
<link rel="canonical" href="${thing.canonical_link}" />
%if hasattr(thing, "shortlink"):
<link rel="shorturl" href="${thing.shortlink}" />
%endif
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<title>${self.Title()}</title>

View File

@@ -62,6 +62,10 @@
%endif
%endif
%if hasattr(thing, "shortlink"):
<link rel="shorturl" href="${thing.shortlink}"/>
%endif
%if c.allow_styles and c.site.stylesheet_contents:
<% inline_stylesheet = (
len(c.site.stylesheet_contents) < 1024