From e90aa39b6447ceef78d31d4c68291585eb02244a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 19 Jan 2016 01:16:19 +0000 Subject: repobrowse: nofollow and noindex tree links It is expensive and of dubious usefulness to have tree content auto-followed and indexed by search engines. Reduce the links we recommend to crawlers so they don't waste resources of users running our code or waste the time of search engine users finding low-value content. We will allow indexing blobs, however, as they may contain useful information for others to refer to. Of course, I definitely want search engines to index commit messages; as I consider those to be the most important data served. --- lib/PublicInbox/RepobrowseBase.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/RepobrowseBase.pm') diff --git a/lib/PublicInbox/RepobrowseBase.pm b/lib/PublicInbox/RepobrowseBase.pm index 6223ebde..14926d70 100644 --- a/lib/PublicInbox/RepobrowseBase.pm +++ b/lib/PublicInbox/RepobrowseBase.pm @@ -58,11 +58,21 @@ sub mime_type { # starts an HTML page for Repobrowse in a consistent way sub html_start { - my ($self, $req, $title_html) = @_; + my ($self, $req, $title_html, $opts) = @_; my $desc = $req->{repo_info}->{desc_html}; + my $meta; + + if ($opts) { + my @robots; + foreach (qw(nofollow noindex)) { + push @robots, $_ if $opts->{$_}; + } + $meta = qq('; + } "$title_html" . - PublicInbox::Hval::STYLE . + PublicInbox::Hval::STYLE . $meta . "
$desc";
 }
 
-- 
cgit v1.2.3-24-ge0c7