diff options
Diffstat (limited to 'modules/caddyhttp/templates')
| -rw-r--r-- | modules/caddyhttp/templates/caddyfile.go | 11 | ||||
| -rw-r--r-- | modules/caddyhttp/templates/templates.go | 22 | 
2 files changed, 16 insertions, 17 deletions
| diff --git a/modules/caddyhttp/templates/caddyfile.go b/modules/caddyhttp/templates/caddyfile.go index ea6aa9f..06ca3e2 100644 --- a/modules/caddyhttp/templates/caddyfile.go +++ b/modules/caddyhttp/templates/caddyfile.go @@ -25,12 +25,11 @@ func init() {  // parseCaddyfile sets up the handler from Caddyfile tokens. Syntax:  // -//     templates [<matcher>] { -//         mime <types...> -//         between <open_delim> <close_delim> -//         root <path> -//     } -// +//	templates [<matcher>] { +//	    mime <types...> +//	    between <open_delim> <close_delim> +//	    root <path> +//	}  func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) {  	t := new(Templates)  	for h.Next() { diff --git a/modules/caddyhttp/templates/templates.go b/modules/caddyhttp/templates/templates.go index e32e1c3..449536a 100644 --- a/modules/caddyhttp/templates/templates.go +++ b/modules/caddyhttp/templates/templates.go @@ -152,10 +152,10 @@ func init() {  //  // Accesses the current HTTP request, which has various fields, including:  // -//    - `.Method` - the method -//    - `.URL` - the URL, which in turn has component fields (Scheme, Host, Path, etc.) -//    - `.Header` - the header fields -//    - `.Host` - the Host or :authority header of the request +//   - `.Method` - the method +//   - `.URL` - the URL, which in turn has component fields (Scheme, Host, Path, etc.) +//   - `.Header` - the header fields +//   - `.Host` - the Host or :authority header of the request  //  // ```  // {{.Req.Header.Get "User-Agent"}} @@ -221,15 +221,16 @@ func init() {  // ---  // ```  // -//  // **JSON** is simply `{` and `}`:  //  // ``` -// { -// 	"template": "blog", -// 	"title": "Blog Homepage", -// 	"sitename": "A Caddy site" -// } +// +//	{ +//		"template": "blog", +//		"title": "Blog Homepage", +//		"sitename": "A Caddy site" +//	} +//  // ```  //  // The resulting front matter will be made available like so: @@ -237,7 +238,6 @@ func init() {  // - `.Meta` to access the metadata fields, for example: `{{$parsed.Meta.title}}`  // - `.Body` to access the body after the front matter, for example: `{{markdown $parsed.Body}}`  // -//  // ##### `stripHTML`  //  // Removes HTML from a string. | 
