Land on Blogs page when SimpleNav is enabled

This shows the Blogs page instead of the Editor to logged in users on
the `/` path when the new `simple_nav` config option is enabled.

Ref T680
This commit is contained in:
Matt Baer 2019-08-05 09:27:51 -04:00
parent f6a7dfacb9
commit 81847fbbcc
2 changed files with 7 additions and 1 deletions

7
app.go
View File

@ -193,7 +193,12 @@ func handleViewHome(app *App, w http.ResponseWriter, r *http.Request) error {
// Show correct page based on user auth status and configured landing path
u := getUserSession(app, r)
if u != nil {
// User is logged in, so show the Pad
// User is logged in, so show the Pad or Blogs page, depending on config
if app.cfg.App.SimpleNav {
// Simple nav, so home page is Blogs page
return viewCollections(app, u, w, r)
}
// Default config, so home page is editor
return handleViewPad(app, w, r)
}

View File

@ -68,6 +68,7 @@ type (
JSDisabled bool `ini:"disable_js"`
WebFonts bool `ini:"webfonts"`
Landing string `ini:"landing"`
SimpleNav bool `ini:"simple_nav"`
// Users
SingleUser bool `ini:"single_user"`