FEATURE: new 'Discourse-Render' HTTP header

This commit is contained in:
Régis Hanol
2019-08-30 20:45:18 +02:00
parent 34ac199be7
commit 75eebc904e
2 changed files with 18 additions and 11 deletions

View File

@ -102,6 +102,13 @@ class ApplicationController < ActionController::Base
end
def set_layout
case request.headers["Discourse-Render"]
when "desktop"
return "application"
when "crawler"
return "crawler"
end
use_crawler_layout? ? 'crawler' : 'application'
end