set title

This commit is contained in:
maddalax 2024-10-30 13:39:07 -05:00
parent 2e60b84c83
commit 1ce5f37fc4
2 changed files with 5 additions and 1 deletions

View file

@ -40,6 +40,9 @@ func ConfigurableRootPage(ctx *h.RequestContext, props RootPageProps) *h.Page {
h.Head(
h.Meta("viewport", "width=device-width, initial-scale=1"),
h.Meta("title", title),
h.Title(
h.Text(title),
),
h.Link("/public/favicon.ico", "icon"),
h.Link("/public/apple-touch-icon.png", "apple-touch-icon"),
h.Meta("charset", "utf-8"),

View file

@ -1,6 +1,7 @@
package docs
import (
"fmt"
"github.com/maddalax/htmgo/framework/h"
"htmgo-site/pages/base"
"htmgo-site/partials"
@ -116,7 +117,7 @@ func DocPage(ctx *h.RequestContext, children ...h.Ren) *h.Page {
for _, section := range sections {
for _, page := range section.Pages {
if page.Path == ctx.Request.URL.Path {
title = page.Title
title = fmt.Sprintf("Docs - %s", page.Title)
break
}
}