mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 13:40:38 +03:00
tpl: Add templates.Current
This commit also * Unexport all internal state in TemplateInfo. * Make the dispatcher keys used for passing context.Context into uint8 from string to save memory allocations. Co-authored-by: Joe Mooring <joe@mooring.com> Updates #13571
This commit is contained in:
parent
af0602c343
commit
d4c6dd16b1
13 changed files with 322 additions and 123 deletions
|
@ -139,9 +139,13 @@ func (i HugoInfo) IsMultilingual() bool {
|
|||
return i.conf.IsMultilingual()
|
||||
}
|
||||
|
||||
type contextKey string
|
||||
type contextKey uint8
|
||||
|
||||
var markupScope = hcontext.NewContextDispatcher[string](contextKey("markupScope"))
|
||||
const (
|
||||
contextKeyMarkupScope contextKey = iota
|
||||
)
|
||||
|
||||
var markupScope = hcontext.NewContextDispatcher[string](contextKeyMarkupScope)
|
||||
|
||||
type Context struct{}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue