Permalink
Browse files

Merge pull request #115 from fcambus/master

Removing sitewide nofollow preventing pages indexation, and setting it only on external links anchors
  • Loading branch information...
2 parents f538d0f + 119d61e commit 982288588e1fbb0072a8cc87ed087f09b5cc4640 @antirez committed Oct 9, 2012
Showing with 6 additions and 6 deletions.
  1. +5 −5 app.rb
  2. +1 −1 page.rb
View
10 app.rb
@@ -963,7 +963,7 @@ def get_rand
# failed (detected testing the first return value).
def create_user(username,password)
if $r.exists("username.to.id:#{username.downcase}")
- return nil, "Username is busy, please try a different one."
+ return nil, "Username is already taken, please try a different one."
end
if rate_limit_by_ip(3600*15,"create_user",request.ip)
return nil, "Please wait some time before creating a new user."
@@ -1423,7 +1423,7 @@ def news_to_html(news)
"▲"
}+" "+
H.h2 {
- H.a(:href=>news["url"]) {
+ H.a(:href=>news["url"], :rel => "nofollow") {
H.entities news["title"]
}
}+" "+
@@ -1630,13 +1630,13 @@ def compute_comment_score(c)
# HTML links. We try to handle the case of an url that is followed by a period
# Like in "I suggest http://google.com." excluding the final dot from the link.
def urls_to_links(s)
- urls = /((https?:\/\/|www\.)([-\w\.]+)+(:\d+)?(\/([\w\/_\.\-\%]*(\?\S+)?)?)?)/
+ urls = /((https?:\/\/|www\.)([-\w\.]+)+(:\d+)?(\/([\w\/_#\.\-\%]*(\?\S+)?)?)?)/
s.gsub(urls) {
if $1[-1..-1] == '.'
url = $1.chop
- '<a href="'+url+'">'+url+'</a>.'
+ '<a rel="nofollow" href="'+url+'">'+url+'</a>.'
else
- '<a href="'+$1+'">'+$1+'</a>'
+ '<a rel="nofollow" href="'+$1+'">'+$1+'</a>'
end
}
end
View
@@ -127,7 +127,7 @@ def page()
H.head {
self.meta(:charset => "utf-8")+
self.title{H.entities @title}+
- self.meta(:content => :nofollow, :name => :robots)+
+ self.meta(:content => :index, :name => :robots)+
self.link(:href => "/css/style.css?v=8", :rel => "stylesheet",
:type => "text/css")+
self.link(:href => "/images/favicon.png", :rel => "shortcut icon")+

0 comments on commit 9822885

Please sign in to comment.