diff --git a/htmgo-site/pages/base/root.go b/htmgo-site/pages/base/root.go index b110caa..324d7e5 100644 --- a/htmgo-site/pages/base/root.go +++ b/htmgo-site/pages/base/root.go @@ -25,6 +25,7 @@ func RootPage(ctx *h.RequestContext, children ...h.Ren) *h.Element { h.Meta("og:title", title), h.Meta("og:url", "https://htmgo.dev"), h.Link("canonical", "https://htmgo.dev"), + h.Link("https://cdn.jsdelivr.net/npm/@docsearch/css@3", "stylesheet"), h.Meta("og:description", description), h.LinkWithVersion("/public/main.css", "stylesheet", Version), h.ScriptWithVersion("/public/htmgo.js", Version), @@ -37,6 +38,16 @@ func RootPage(ctx *h.RequestContext, children ...h.Ren) *h.Element { h.Body( h.Class("bg-stone-50 h-screen"), h.Fragment(children...), + h.Script("https://cdn.jsdelivr.net/npm/@docsearch/js@3"), + h.UnsafeRawScript(` + docsearch({ + appId: "9IO2WZA8L1", + apiKey: "d8cd8b6f8f8a0c961ce971e09dbde90a", + indexName: "htmgo", + container: "#search-container", + debug: false + }); + `), ), ) } diff --git a/htmgo-site/partials/navbar.go b/htmgo-site/partials/navbar.go index 0bb2345..913e09f 100644 --- a/htmgo-site/partials/navbar.go +++ b/htmgo-site/partials/navbar.go @@ -95,6 +95,9 @@ func NavBar(ctx *h.RequestContext, props NavBarProps) *h.Element { h.Href("/"), h.Text("htmgo"), )), + h.Div( + h.Id("search-container"), + ), h.Div( h.Class("flex gap-4 items-center"), h.List(navItems, func(item NavItem, index int) *h.Element {