Multiple pages

This commit is contained in:
Eden Kirin
2024-01-21 01:18:56 +01:00
parent 1bfc72b44b
commit 42ac91ce64
13 changed files with 342 additions and 25 deletions

15
app/handlers/about.go Normal file
View File

@ -0,0 +1,15 @@
package handlers
import (
"templ-tests/app/templates"
"github.com/gin-gonic/gin"
)
func About(c *gin.Context) {
pc := templates.PageContext{
Title: "Welcome to the demo - About",
ActivePage: "about",
}
templates.About(pc).Render(c, c.Writer)
}

View File

@ -7,5 +7,9 @@ import (
)
func Home(c *gin.Context) {
templates.Home("World").Render(c, c.Writer)
pc := templates.PageContext{
Title: "Welcome to the demo",
ActivePage: "home",
}
templates.Home(pc, "World").Render(c, c.Writer)
}