MCPcopy Create free account
hub / github.com/CloudyKit/jet / WithTemplateNameExtensions

Function WithTemplateNameExtensions

set.go:102–109  ·  view source on GitHub ↗

WithTemplateNameExtensions returns an option function that sets the extensions to try when looking up template names in the cache or loader. Default extensions are `""` (no extension), `".jet"`, `".html.jet"`, `".jet.html"`. Extensions will be tried in the order they are defined in the slice. WithTe

(extensions []string)

Source from the content-addressed store, hash-verified

100// `".html.jet"`, `".jet.html"`. Extensions will be tried in the order they are defined in the slice.
101// WithTemplateNameExtensions panics when you pass in a nil or empty slice.
102func WithTemplateNameExtensions(extensions []string) Option {
103 if len(extensions) == 0 {
104 panic(errors.New("jet: WithTemplateNameExtensions() must not be called with a nil or empty slice of extensions"))
105 }
106 return func(s *Set) {
107 s.extensions = extensions
108 }
109}
110
111// InDevelopmentMode returns an option function that toggles development mode on, meaning the cache will
112// always be bypassed and every template lookup will go to the loader.

Callers 1

TestSetSetExtensionsFunction · 0.85

Calls 1

NewMethod · 0.80

Tested by 1

TestSetSetExtensionsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…