mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
templates: Document httpError
function (#4972)
* added the httpError function into the document * Update templates.go * Update templates.go * Fix gofmt Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
parent
f2a7e7c966
commit
66959d9f18
1 changed files with 8 additions and 0 deletions
|
@ -189,6 +189,14 @@ func init() {
|
|||
// {{.RespHeader.Set "Field-Name" "val"}}
|
||||
// ```
|
||||
//
|
||||
// ##### `httpError`
|
||||
//
|
||||
// Returns an error with the given status code to the HTTP handler chain.
|
||||
//
|
||||
// ```
|
||||
// {{if not (fileExists $includedFile)}}{{httpError 404}}{{end}}
|
||||
// ```
|
||||
//
|
||||
// ##### `splitFrontMatter`
|
||||
//
|
||||
// Splits front matter out from the body. Front matter is metadata that appears at the very beginning of a file or string. Front matter can be in YAML, TOML, or JSON formats:
|
||||
|
|
Loading…
Reference in a new issue