2024-09-20 16:45:23 +00:00
|
|
|
package base
|
|
|
|
|
|
|
|
|
|
import (
|
2024-09-24 18:05:38 +00:00
|
|
|
"github.com/google/uuid"
|
2024-09-20 16:45:23 +00:00
|
|
|
"github.com/maddalax/htmgo/framework/h"
|
|
|
|
|
"htmgo-site/partials"
|
|
|
|
|
)
|
|
|
|
|
|
2024-09-24 18:05:38 +00:00
|
|
|
var Version = uuid.NewString()[0:6]
|
|
|
|
|
|
2024-09-20 16:45:23 +00:00
|
|
|
func RootPage(children ...h.Ren) *h.Element {
|
2024-09-25 16:00:31 +00:00
|
|
|
title := "htmgo"
|
|
|
|
|
description := "build simple and scalable systems with go + htmx"
|
|
|
|
|
|
2024-09-20 16:45:23 +00:00
|
|
|
return h.Html(
|
2024-09-22 15:46:38 +00:00
|
|
|
h.HxExtension(h.BaseExtensions()),
|
2024-09-20 16:45:23 +00:00
|
|
|
h.Head(
|
|
|
|
|
h.Meta("viewport", "width=device-width, initial-scale=1"),
|
2024-09-25 16:00:31 +00:00
|
|
|
h.Meta("title", title),
|
|
|
|
|
h.Meta("charset", "utf-8"),
|
|
|
|
|
h.Meta("author", "htmgo"),
|
|
|
|
|
h.Meta("description", description),
|
|
|
|
|
h.Meta("og:title", title),
|
2024-09-25 03:41:03 +00:00
|
|
|
h.Meta("og:url", "https://htmgo.dev"),
|
|
|
|
|
h.Link("canonical", "https://htmgo.dev"),
|
2024-09-25 16:00:31 +00:00
|
|
|
h.Meta("og:description", description),
|
2024-09-24 18:05:38 +00:00
|
|
|
h.LinkWithVersion("/public/main.css", "stylesheet", Version),
|
|
|
|
|
h.ScriptWithVersion("/public/htmgo.js", Version),
|
2024-09-20 16:45:23 +00:00
|
|
|
h.Raw(`
|
2024-09-24 18:23:38 +00:00
|
|
|
<script src="https://buttons.github.io/buttons.js"></script>
|
2024-09-20 16:45:23 +00:00
|
|
|
`),
|
2024-09-23 19:41:43 +00:00
|
|
|
h.Style(`
|
|
|
|
|
html {
|
|
|
|
|
scroll-behavior: smooth;
|
|
|
|
|
}
|
|
|
|
|
`),
|
2024-09-20 16:45:23 +00:00
|
|
|
),
|
2024-09-20 20:15:12 +00:00
|
|
|
h.Body(
|
2024-09-24 17:39:16 +00:00
|
|
|
h.Class("bg-stone-50 min-h-screen overflow-x-hidden"),
|
2024-09-20 20:15:12 +00:00
|
|
|
partials.NavBar(false),
|
|
|
|
|
h.Fragment(children...),
|
|
|
|
|
),
|
2024-09-20 16:45:23 +00:00
|
|
|
)
|
|
|
|
|
}
|