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

View File

@@ -1672,6 +1672,9 @@ en:
default: "(default)"
any: "any"
homepage:
default: "(default)"
password_confirmation:
title: "Password Again"
@@ -4183,6 +4186,9 @@ en:
this_week: "Week"
today: "Today"
custom_homepage:
admin_message: 'One of your themes has enabled the "custom_homepage" modifier but it does not output anything in the [custom-homepage] connector. (This message is only shown to site administrators.)'
browser_update: 'Unfortunately, <a href="https://www.discourse.org/faq/#browser">your browser is unsupported</a>. Please <a href="https://browsehappy.com">switch to a supported browser</a> to view rich content, log in and reply.'
permission_types:

View File

@@ -1586,6 +1586,8 @@ Discourse::Application.routes.draw do
constraints: HomePageConstraint.new("finish_installation"),
as: "installation_redirect"
root to: "custom#index", constraints: HomePageConstraint.new("custom"), as: "custom_index"
get "/user-api-key/new" => "user_api_keys#new"
post "/user-api-key" => "user_api_keys#create"
post "/user-api-key/revoke" => "user_api_keys#revoke"