add title tag to starter template

This commit is contained in:
maddalax 2024-10-30 13:40:49 -05:00
parent 1ce5f37fc4
commit 965a8487b9

View file

@ -5,23 +5,31 @@ import (
) )
func RootPage(children ...h.Ren) *h.Page { func RootPage(children ...h.Ren) *h.Page {
title := "htmgo template"
description := "an example of the htmgo template"
author := "htmgo"
url := "https://htmgo.dev"
return h.NewPage( return h.NewPage(
h.Html( h.Html(
h.HxExtensions( h.HxExtensions(
h.BaseExtensions(), h.BaseExtensions(),
), ),
h.Head( h.Head(
h.Title(
h.Text(title),
),
h.Meta("viewport", "width=device-width, initial-scale=1"), h.Meta("viewport", "width=device-width, initial-scale=1"),
h.Link("/public/favicon.ico", "icon"), h.Link("/public/favicon.ico", "icon"),
h.Link("/public/apple-touch-icon.png", "apple-touch-icon"), h.Link("/public/apple-touch-icon.png", "apple-touch-icon"),
h.Meta("title", "htmgo template"), h.Meta("title", title),
h.Meta("charset", "utf-8"), h.Meta("charset", "utf-8"),
h.Meta("author", "htmgo"), h.Meta("author", author),
h.Meta("description", "this is a template"), h.Meta("description", description),
h.Meta("og:title", "htmgo template"), h.Meta("og:title", title),
h.Meta("og:url", "https://htmgo.dev"), h.Meta("og:url", url),
h.Link("canonical", "https://htmgo.dev"), h.Link("canonical", url),
h.Meta("og:description", "this is a template"), h.Meta("og:description", description),
h.Link("/public/main.css", "stylesheet"), h.Link("/public/main.css", "stylesheet"),
h.Script("/public/htmgo.js"), h.Script("/public/htmgo.js"),
), ),