Detect Googlebot from user agent and use a different layout that doesn't load javascript

This commit is contained in:
Neil Lalonde
2014-02-15 17:54:34 -05:00
parent 0c493c026e
commit d298e2e065
5 changed files with 83 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
module GooglebotDetection
def self.googlebot?(user_agent)
!/Googlebot|Mediapartners|AdsBot/.match(user_agent).nil?
end
end