page

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PageTemplate  *template.Template
	ErrorTemplate *template.Template
)

Functions

func NewHandler

func NewHandler(renderer Renderer, config types.PageConfig, assetsFS embed.FS, isDev bool, manifest *assets.Manifest) http.Handler

func RenderHTMLShell

func RenderHTMLShell(bodyHTML string, props map[string]any, scriptSrc string, headHTML string, cssHref string, chunks []string) (string, error)

func SetTemplates

func SetTemplates(page, errorTpl string)

func WriteClientEntry

func WriteClientEntry(path string, componentImport string) error

func WriteStaticClientEntry

func WriteStaticClientEntry(path string, componentImport string) error

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Renderer

type Renderer interface {
	Render(componentPath string, props map[string]any) (types.RenderedPage, error)
	Build(entrypoints []string, outdir string) error
}

Jump to

Keyboard shortcuts

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