Fix html title between pages

This commit is contained in:
Luis Eduardo Jeréz Girón
2024-09-08 00:29:18 -06:00
parent 87189c5aee
commit 4a17b3511a

View File

@@ -15,15 +15,16 @@ type DashboardParams struct {
}
func Dashboard(reqCtx reqctx.Ctx, params DashboardParams) gomponents.Node {
if reqCtx.IsHTMXBoosted {
return component.RenderableGroup(params.Body)
}
title := "PG Back Web"
if params.Title != "" {
title = params.Title + " - " + title
}
if reqCtx.IsHTMXBoosted {
body := append(params.Body, html.TitleEl(gomponents.Text(title)))
return component.RenderableGroup(body)
}
return components.HTML5(components.HTML5Props{
Language: "en",
Title: title,