2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

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