Emit route-specific title, description, canonical, Open Graph, and X/Twitter Card tags in the initial HTML response.
Social MetadataRendered example
One route config, complete social contract
Metadata defaults to website plus a large-image card and rejects incomplete or non-HTTPS configurations before writing tags.
Social Metadata
<head>@head.Metadata(head.MetadataConfig{Title:"Product documentation",Description:"Learn how to use the product.",CanonicalURL:"https://example.com/docs",SiteName:"Example",Locale:"en_US",Image:head.SocialImage{URL:"https://example.com/social/docs-v1.jpg",MIMEType:"image/jpeg",Width:1280,Height:640,Alt:"Example product documentation",},})@head.Dependencies()</head>
Minimal Runtime
Use DependenciesMinimal when the page does not need the Alpine collapse, focus, or mask plugins.
Minimal RuntimeRendered example
DependenciesMinimal
CSS, the combined first-party bundle, Alpine core, and HTMX. Optional manifest entries still follow their IncludeInMinimal setting.
Minimal Runtime
<head>@head.DependenciesMinimal()</head>
Asset Mount Contract
Both helpers require the embedded asset handler at /assets/ for CSS, the loader, first-party helpers, and local fallback.
Use functional options to make the runtime fully local, replace one dependency's CDN/fallback pair, omit an application-owned dependency, or disable fallback.
Local-only and custom sourcesRendered example
Strong defaults, explicit escape hatches
The default falls back to embedded assets with SHA-384 integrity. Local-only mode supports offline PWAs and WebViews; per-dependency options keep version ownership visible.
Custom URLs configure loading only. Goshtoso guarantees compatibility for its pinned, tested dependency combination—not arbitrary versions.
Local-only and custom sources
// Choose one mode for the page:@head.Dependencies(head.WithLocalRuntime())// Or customize the resilient mode:@head.Dependencies(head.WithDependencyCDNURL(head.DependencyHTMX,"https://cdn.example.com/htmx-2.0.8.min.js"),head.WithDependencyLocalURL(head.DependencyHTMX,"/static/htmx-2.0.8.min.js"),head.WithDependencyIntegrity(head.DependencyHTMX,"sha384-..."),)
Typed manifest ownership
Start from the pinned public manifest when the application must enable optional runtimes, add a script, omit a dependency, or declare another safe order.
Typed manifest ownershipRendered example
One typed, ordered baseline
WithRuntimeManifest snapshots caller data and validates roles, URLs, loader availability, known runtime order, and first-party conflicts before writing HTML.
Typed manifest ownership
runtime:=assets.DefaultRuntimeManifest()// Enable or edit entries by RuntimeAssetRole, then add application-owned code.runtime.Dependencies=append(runtime.Dependencies,assets.RuntimeAsset{Role:"application-runtime",Kind:assets.RuntimeAssetScript,PrimaryURL:"/static/application-runtime.js",LocalURL:"/static/application-runtime.js",Enabled:true,})@head.Dependencies(head.WithRuntimeManifest(runtime))
Go API
v0.2.7
The examples above cover behavior and composition. pkg.go.dev is the canonical reference for exported types, functions, methods, and Go documentation.
Goshtoso can store preferences and demo state in your browser. Some examples use cookies and IndexedDB to persist local demo state. There is no analytics, advertising, or third-party tracking. You can use the site without storage, but preferences and some examples will reset or stop persisting. Details in our Privacy Policy.