package views
import "fmt"
var (
nebulaHandle = templ.NewOnceHandle()
tailwindHandle = templ.NewOnceHandle()
alpineHandle = templ.NewOnceHandle()
dexieHandle = templ.NewOnceHandle()
htmxHandle = templ.NewOnceHandle()
turnstileHandle = templ.NewOnceHandle()
)
templ Head(title string, nebulaVersion string) {
@Turnstile()
@Tailwind()
@Alpine()
@Htmx()
@Dexie()
@Nebula(nebulaVersion)
{ title }
{ children... }
}
// ╭──────────────────────────────────────────────────────────╮
// │ 3rd Party Libraries │
// ╰──────────────────────────────────────────────────────────╯
// Tailwind css dependencies
templ Tailwind() {
@tailwindHandle.Once() {
}
}
// Turnstile is used for cloudflare challenges
templ Turnstile() {
@turnstileHandle.Once() {
}
}
// Alpine is a component that renders the Alpine.js library
templ Alpine() {
@alpineHandle.Once() {
}
}
// Dexie is a component that renders the Dexie.js library
templ Dexie() {
@dexieHandle.Once() {
}
}
// Htmx is a component that renders the Htmx.js library
templ Htmx() {
@htmxHandle.Once() {
}
}
// Nebula is a component that renders the Nebula.js library
templ Nebula(version string) {
@nebulaHandle.Once() {
}
}
// ╭───────────────────────────────────────────────────────────╮
// │ Helper Functions │
// ╰───────────────────────────────────────────────────────────╯
func jsDelivrURL(pkg string, version string, path string) string {
return fmt.Sprintf("https://cdn.jsdelivr.net/npm/%s@%s/%s", pkg, version, path)
}