Skip to content

Commit

Permalink
Fix html title between pages
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardolat committed Sep 8, 2024
1 parent 87189c5 commit 4a17b35
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/view/web/layout/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4a17b35

Please sign in to comment.