Improved layout middleware

This commit is contained in:
2019-06-03 14:53:04 +09:00
parent 3268488b7b
commit cf68184c46
6 changed files with 24 additions and 18 deletions

View File

@ -1,9 +1,12 @@
package page
import "github.com/aerogo/aero"
import (
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/middleware"
)
// Get registers a layout rendered route and a contents-only route.
func Get(app *aero.Application, route string, handler aero.Handler) {
app.Get(route, handler)
app.Get(route, middleware.Layout(handler))
app.Get("/_"+route, handler)
}