Refactor: Menu

This commit is contained in:
Tom Wiesing 2023-02-03 15:46:53 +01:00
parent a7309d5268
commit 7f820224ec
No known key found for this signature in database
16 changed files with 103 additions and 92 deletions

View file

@ -127,12 +127,16 @@ type newsContext struct {
Items []Item
}
var (
menuNews = component.MenuItem{Title: "News", Path: "/news/"}
)
// HandleRoute returns the handler for the requested path
func (news *News) HandleRoute(ctx context.Context, path string) (http.Handler, error) {
tpl := newsTemplate.Prepare(
news.Dependencies.Templating,
templating.Crumbs(
component.MenuItem{Title: "News", Path: "/news/"},
menuNews,
),
)