Update module path from forge.lthn.ai/core/go-html to dappco.re/go/core/html. Migrate all .go import paths, update dependency versions (core v0.5.0, log v0.1.0, io v0.2.0), and add replace directives for local development. Co-Authored-By: Virgil <virgil@lethean.io>
27 lines
644 B
Go
27 lines
644 B
Go
package html
|
|
|
|
import i18n "dappco.re/go/core/i18n"
|
|
|
|
// Context carries rendering state through the node tree.
|
|
type Context struct {
|
|
Identity string
|
|
Locale string
|
|
Entitlements func(feature string) bool
|
|
Data map[string]any
|
|
service *i18n.Service
|
|
}
|
|
|
|
// NewContext creates a new rendering context with sensible defaults.
|
|
func NewContext() *Context {
|
|
return &Context{
|
|
Data: make(map[string]any),
|
|
}
|
|
}
|
|
|
|
// NewContextWithService creates a rendering context backed by a specific i18n service.
|
|
func NewContextWithService(svc *i18n.Service) *Context {
|
|
return &Context{
|
|
Data: make(map[string]any),
|
|
service: svc,
|
|
}
|
|
}
|