Use consts for route names and templates.

This commit is contained in:
mikestefanello 2023-12-16 11:07:20 -05:00
parent a787d5dc7f
commit 60c8aefd49
30 changed files with 135 additions and 82 deletions

View file

@ -4,6 +4,7 @@ import (
"fmt"
"github.com/mikestefanello/pagoda/pkg/controller"
"github.com/mikestefanello/pagoda/templates"
"github.com/labstack/echo/v4"
)
@ -21,8 +22,8 @@ type (
func (c *home) Get(ctx echo.Context) error {
page := controller.NewPage(ctx)
page.Layout = "main"
page.Name = "home"
page.Layout = templates.LayoutMain
page.Name = templates.PageHome
page.Metatags.Description = "Welcome to the homepage."
page.Metatags.Keywords = []string{"Go", "MVC", "Web", "Software"}
page.Pager = controller.NewPager(ctx, 4)