You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ r := render.New(render.Options{
99
99
HTMLContentType: "application/xhtml+xml", // Output XHTML content type instead of default "text/html".
100
100
IsDevelopment: true, // Render will now recompile the templates on every HTML response.
101
101
UseMutexLock: true, // Overrides the default no lock implementation and uses the standard `sync.RWMutex` lock.
102
-
UnEscapeHTML: true, //Replace ensure '&<>' are output correctly (JSON only).
102
+
UnEscapeHTML: true, //Ensure '&<>' are output correctly (JSON only).
103
103
StreamingJSON: true, // Streams the JSON response via json.Encoder.
104
104
HTMLTemplateOption: "missingkey=error", // Sets the option value for HTML templates. See https://pkg.go.dev/html/template#Template.Option for a list of known options.
105
105
RequirePartials: true, // Return an error if a template is missing a partial used in a layout.
Copy file name to clipboardexpand all lines: render.go
+16-8
Original file line number
Diff line number
Diff line change
@@ -67,13 +67,15 @@ type Options struct {
67
67
Layoutstring
68
68
// Extensions to parse template files from. Defaults to [".tmpl"].
69
69
Extensions []string
70
-
// Funcs is a slice of FuncMaps to apply to the template upon compilation. This is useful for helper functions. Defaults to empty map.
70
+
// Funcs is a slice of FuncMaps to apply to the template upon compilation.
71
+
// This is useful for helper functions. Defaults to empty map.
71
72
Funcs []template.FuncMap
72
73
// Delims sets the action delimiters to the specified strings in the Delims struct.
73
74
DelimsDelims
74
75
// Appends the given character set to the Content-Type header. Default is "UTF-8".
75
76
Charsetstring
76
-
// If DisableCharset is set to true, it will not append the above Charset value to the Content-Type header. Default is false.
77
+
// If DisableCharset is set to true, it will not append the above Charset value to the Content-Type header.
78
+
// Default is false.
77
79
DisableCharsetbool
78
80
// Outputs human readable JSON.
79
81
IndentJSONbool
@@ -97,23 +99,27 @@ type Options struct {
97
99
XMLContentTypestring
98
100
// If IsDevelopment is set to true, this will recompile the templates on every request. Default is false.
99
101
IsDevelopmentbool
100
-
// If UseMutexLock is set to true, the standard `sync.RWMutex` lock will be used instead of the lock free implementation. Default is false.
101
-
// Note that when `IsDevelopment` is true, the standard `sync.RWMutex` lock is always used. Lock free is only a production feature.
102
+
// If UseMutexLock is set to true, the standard `sync.RWMutex` lock will be used instead of the lock free
103
+
// implementation. Default is false. Note that when `IsDevelopment` is true, the standard `sync.RWMutex`
104
+
// lock is always used. Lock free is only a production feature.
102
105
UseMutexLockbool
103
106
// Unescape HTML characters "&<>" to their original values. Default is false.
104
107
UnEscapeHTMLbool
105
108
// Sets the `Option` value for HTML templates. Defaults to blank ("").
106
109
HTMLTemplateOptionstring
107
110
// Streams JSON responses instead of marshalling prior to sending. Default is false.
108
111
StreamingJSONbool
109
-
// Require that all partials executed in the layout are implemented in all templates using the layout. Default is false.
112
+
// Require that all partials executed in the layout are implemented in all templates using the layout.
113
+
// Default is false.
110
114
RequirePartialsbool
111
115
// Deprecated: Use the above `RequirePartials` instead of this. As of Go 1.6, blocks are built in. Default is false.
112
116
RequireBlocksbool
113
117
// Disables automatic rendering of http.StatusInternalServerError when an error occurs. Default is false.
114
118
DisableHTTPErrorRenderingbool
115
-
// Enables using partials without the current filename suffix which allows use of the same template in multiple files. e.g {{ partial "carosuel" }} inside the home template will match carosel-home or carosel.
116
-
// ***NOTE*** - This option should be named RenderPartialsWithoutSuffix as that is what it does. "Prefix" is a typo. Maintaining the existing name for backwards compatibility.
119
+
// Enables using partials without the current filename suffix which allows use of the same template in
120
+
// multiple files. e.g {{ partial "carousel" }} inside the home template will match carousel-home or carousel.
121
+
// ***NOTE*** - This option should be named RenderPartialsWithoutSuffix as that is what it does.
122
+
// "Prefix" is a typo. Maintaining the existing name for backwards compatibility.
117
123
RenderPartialsWithoutPrefixbool
118
124
// BufferPool to use when rendering HTML templates. If none is supplied
119
125
// defaults to SizedBufferPool of size 32 with 512KiB buffers.
0 commit comments