html

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BaseTemplate = `` /* 1592-byte string literal not displayed */
View Source
const ErrorTemplate = `` /* 724-byte string literal not displayed */

Variables

This section is empty.

Functions

func RenderError

func RenderError(e error, routeID string) []byte

RenderError Renders the error template with the given error

func RenderHTMLString

func RenderHTMLString(params Params) []byte

RenderHTMLString Renders the HTML template in internal/html with the given parameters

Types

type ErrorParams

type ErrorParams struct {
	Error   string
	RouteID string
	IsDev   bool
}

type Params

type Params struct {
	Title      string
	MetaTags   map[string]string
	OGMetaTags map[string]string
	Links      []struct {
		Href     string
		Rel      string
		Media    string
		Hreflang string
		Type     string
		Title    string
	}
	JS         template.JS
	JSPath     string // External JS file path (if set, use <script src> instead of inline)
	CSS        template.CSS
	CSSPath    string      // External CSS file path (if set, use <link href> instead of inline)
	PropsJSON  template.JS // SSR props as JSON for client hydration
	RouteID    string
	IsDev      bool
	ServerHTML template.HTML
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL