CHANGE: We now include the _escaped_fragment_ support by default, but

only if the crawler check fails. It is a fallback for non-google search
engines that support the Ajax crawling API.
This commit is contained in:
Robin Ward
2014-02-20 17:02:26 -05:00
parent c4b5455c21
commit d95887c57d
17 changed files with 82 additions and 21 deletions

View File

@ -39,8 +39,12 @@ class ApplicationController < ActionController::Base
layout :set_layout
def has_escaped_fragment?
SiteSetting.enable_escaped_fragments? && params.key?("_escaped_fragment_")
end
def set_layout
CrawlerDetection.crawler?(request.user_agent) ? 'crawler' : 'application'
has_escaped_fragment? || CrawlerDetection.crawler?(request.user_agent) ? 'crawler' : 'application'
end
rescue_from Exception do |exception|