I’m trying to reroute the forum from the root path / to a subpath (i.e. /forum) in order to show another page at the root path.
For now, I just want be able to show the forum at /forum. I do not want to install Discourse on that subpath, though.
First of all, via a plugin, I add the following route:
Discourse::Application.routes.append do
get '/forum' => 'list#latest'
end
Next, I tried to add a fitting route to app-route-map.js.es6#L18, replacing the following
this.route('discovery', { path: '/', resetNamespace: true }, // …
with
this.route('discovery', { path: '/forum', resetNamespace: true }, // …
So far, this is not working as I’d hoped. In particular, the first Ember transition is from '' to discovery.index whereas a regular installation will transition from '' to discovery.latest.
Can anyone offer some help as to what I’ve missed or misunderstood?
I’m aware that this might be an unusual request.
Update, June 8th, 18:27: The following works when going to /forum/latest:
plugins/plugin-name/plugin.rb:
Discourse::Application.routes.append do
get '/forum/latest' => 'list#latest'
end
app/assets/javascripts/discourse/routes/app-route-map.js.es6:
this.route('discovery', { path: '/forum', resetNamespace: true }, // …
Now, how would I set things up to be able to open /forum with the same result?
Update, June 8th, 20:09: Additionally, the following changes need to be made to have the navigation bar links work under the subpath:
-
app/assets/javascripts/discourse/models/nav-item.js.es6:
ChangeDiscourse.getURL("/")toDiscourse.getURL("/forum/"). -
app/assets/javascripts/select-kit/components/category-drop.js.es6:
ChangeDiscourse.getURL("/c/")toDiscourse.getURL("/forum/c/").
Probably, other similar changes need to be made to.
