diffs (61 lines):
diff -r ae24b6213f26 -r 24b872df4280 cgi-bin/LJ/S2/EntryPage.pm
--- a/cgi-bin/LJ/S2/EntryPage.pm Tue Jul 21 03:08:47 2009 -0500
+++ b/cgi-bin/LJ/S2/EntryPage.pm Tue Jul 21 03:26:47 2009 -0500
@@ -54,6 +54,11 @@ sub EntryPage
my $next_url = S2::Builtin::LJ::Entry__get_link( $opts->{ctx}, $s2entry,
"nav_next" )->{url};
$p->{head_content} .= qq{<link rel="next" href="$next_url" />\n} if
$next_url;
+
+ # canonical link to the entry or comment thread
+ my $canonical_url = $permalink;
+ $canonical_url .= "?thread=$get->{thread}#t$get->{thread}" if
$get->{thread};
+ $p->{head_content} .= qq{<link rel="canonical" href="$canonical_url" />\n};
# quickreply js libs
LJ::need_res(qw(
diff -r ae24b6213f26 -r 24b872df4280 cgi-bin/LJ/S2/ReplyPage.pm
--- a/cgi-bin/LJ/S2/ReplyPage.pm Tue Jul 21 03:08:47 2009 -0500
+++ b/cgi-bin/LJ/S2/ReplyPage.pm Tue Jul 21 03:26:47 2009 -0500
@@ -42,6 +42,12 @@ sub ReplyPage
return if $opts->{'handler_return'};
return if $opts->{'redir'};
my $ditemid = $entry->ditemid;
+
+ # canonical link to the entry or comment thread
+ my $canonical_url = $entry->url;
+ $canonical_url .= "?thread=$get->{replyto}#t$get->{replyto}" if
$get->{replyto};
+ $p->{head_content} .= qq{<link rel="canonical" href="$canonical_url" />\n};
+
$p->{'head_content'} .= $LJ::COMMON_CODE{'chalresp_js'};
LJ::need_res('stc/display_none.css');
diff -r ae24b6213f26 -r 24b872df4280 htdocs/talkpost.bml
--- a/htdocs/talkpost.bml Tue Jul 21 03:08:47 2009 -0500
+++ b/htdocs/talkpost.bml Tue Jul 21 03:26:47 2009 -0500
@@ -136,6 +136,11 @@ body<=
my $ditemid = $init->{'ditemid'};
my $talkurl = LJ::journal_base($u) . "/$ditemid.html";
my $entry = LJ::Entry->new($u, ditemid => $ditemid);
+
+ # canonical link to the entry or comment thread
+ my $canonical_url = $entry->url;
+ $canonical_url .= "?thread=$GET{replyto}#t$GET{replyto}" if $GET{replyto};
+ $head .= qq{<link rel="canonical" href="$canonical_url" />\n};
$parpost ||= $item; # if there's no parent post, remote is reply to
top-level item
diff -r ae24b6213f26 -r 24b872df4280 htdocs/talkread.bml
--- a/htdocs/talkread.bml Tue Jul 21 03:08:47 2009 -0500
+++ b/htdocs/talkread.bml Tue Jul 21 03:26:47 2009 -0500
@@ -117,6 +117,11 @@ body<=
}
my $entry = LJ::Entry->new($u, ditemid => $ditemid);
+
+ # canonical link to the entry or comment thread
+ my $canonical_url = $entry->url;
+ $canonical_url .= "?thread=$GET{thread}#t$GET{thread}" if $GET{thread};
+ $$head .= qq{<link rel="canonical" href="$canonical_url" />\n};
$u->preload_props("opt_blockrobots", "adult_content") if $u->is_visible;
if (!$u->is_visible || $u->should_block_robots || ($entry &&
$entry->should_block_robots)) {
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog