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)
| 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. |
| 102 | func 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. |
searching dependent graphs…