DEV: allow themes to render their own custom homepage (#26291)

This PR adds a theme modifier and route so that custom themes can opt to show their own homepage. See PR description for example usage.
This commit is contained in:
Penar Musaraj
2024-04-02 11:05:08 -04:00
committed by GitHub
parent 7eec13375d
commit 1eb70973a2
22 changed files with 271 additions and 9 deletions

9
lib/homepage_helper.rb Normal file
View File

@ -0,0 +1,9 @@
# frozen_string_literal: true
class HomepageHelper
def self.resolve(request = nil, current_user = nil)
return "custom" if ThemeModifierHelper.new(request: request).custom_homepage
current_user ? SiteSetting.homepage : SiteSetting.anonymous_homepage
end
end