"Description":"Default checks whether a given value is set and returns a default value if it\nis not. \"Set\" in this context means non-zero for numeric types and times;\nnon-zero length for strings, arrays, slices, and maps;\nany boolean or struct value; or non-nil for any other types.",
"Description":"Eq returns the boolean truth of arg1 == arg2.",
"Args":[
"x",
"y"
],
"Aliases":[
"eq"
],
"Examples":[
[
"{{ if eq .Section \"blog\" }}current{{ end }}",
"current"
]
]
},
"Ge":{
"Description":"Ge returns the boolean truth of arg1 \u003e= arg2.",
"Args":[
"a",
"b"
],
"Aliases":[
"ge"
],
"Examples":[]
},
"Gt":{
"Description":"Gt returns the boolean truth of arg1 \u003e arg2.",
"Args":[
"a",
"b"
],
"Aliases":[
"gt"
],
"Examples":[]
},
"Le":{
"Description":"Le returns the boolean truth of arg1 \u003c= arg2.",
"Args":[
"a",
"b"
],
"Aliases":[
"le"
],
"Examples":[]
},
"Lt":{
"Description":"Lt returns the boolean truth of arg1 \u003c arg2.",
"Args":[
"a",
"b"
],
"Aliases":[
"lt"
],
"Examples":[]
},
"Ne":{
"Description":"Ne returns the boolean truth of arg1 != arg2.",
"Args":[
"x",
"y"
],
"Aliases":[
"ne"
],
"Examples":[]
}
},
"collections":{
"After":{
"Description":"After returns all the items after the first N in a rangeable list.",
"Args":[
"index",
"seq"
],
"Aliases":[
"after"
],
"Examples":[]
},
"Apply":{
"Description":"Apply takes a map, array, or slice and returns a new slice with the function fname applied over it.",
"Args":[
"seq",
"fname",
"args"
],
"Aliases":[
"apply"
],
"Examples":[]
},
"Delimit":{
"Description":"Delimit takes a given sequence and returns a delimited HTML string.\nIf last is passed to the function, it will be used as the final delimiter.",
"Description":"Dictionary creates a map[string]interface{} from the given parameters by\nwalking the parameters and treating them as key-value pairs. The number\nof parameters must be even.",
"Args":[
"values"
],
"Aliases":[
"dict"
],
"Examples":[]
},
"EchoParam":{
"Description":"EchoParam returns a given value if it is set; otherwise, it returns an\nempty string.",
"Args":[
"a",
"key"
],
"Aliases":[
"echoParam"
],
"Examples":[
[
"{{ echoParam .Params \"langCode\" }}",
"en"
]
]
},
"First":{
"Description":"First returns the first N items in a rangeable list.",
"Args":[
"limit",
"seq"
],
"Aliases":[
"first"
],
"Examples":[]
},
"In":{
"Description":"In returns whether v is in the set l. l may be an array or slice.",
"Args":[
"l",
"v"
],
"Aliases":[
"in"
],
"Examples":[
[
"{{ if in \"this string contains a substring\" \"substring\" }}Substring found!{{ end }}",
"Substring found!"
]
]
},
"Index":{
"Description":"Index returns the result of indexing its first argument by the following\narguments. Thus \"index x 1 2 3\" is, in Go syntax, x[1][2][3]. Each\nindexed item must be a map, slice, or array.\n\nCopied from Go stdlib src/text/template/funcs.go.\n\nWe deviate from the stdlib due to https://github.com/golang/go/issues/14751.\n\nTODO(moorereason): merge upstream changes.",
"Args":[
"item",
"indices"
],
"Aliases":[
"index"
],
"Examples":[]
},
"Intersect":{
"Description":"Intersect returns the common elements in the given sets, l1 and l2. l1 and\nl2 must be of the same type and may be either arrays or slices.",
"Args":[
"l1",
"l2"
],
"Aliases":[
"intersect"
],
"Examples":[]
},
"IsSet":{
"Description":"IsSet returns whether a given array, channel, slice, or map has a key\ndefined.",
"Description":"Seq creates a sequence of integers. It's named and used as GNU's seq.\n\nExamples:\n 3 =\u003e 1, 2, 3\n 1 2 4 =\u003e 1, 3\n -3 =\u003e -1, -2, -3\n 1 4 =\u003e 1, 2, 3, 4\n 1 -2 =\u003e 1, 0, -1, -2",
"Args":[
"args"
],
"Aliases":[
"seq"
],
"Examples":[
[
"{{ seq 3 }}",
"[1 2 3]"
]
]
},
"Shuffle":{
"Description":"Shuffle returns the given rangeable list in a randomised order.",
"Args":[
"seq"
],
"Aliases":[
"shuffle"
],
"Examples":[]
},
"Slice":{
"Description":"Slice returns a slice of all passed arguments.",
"Args":[
"args"
],
"Aliases":[
"slice"
],
"Examples":[
[
"{{ slice \"B\" \"C\" \"A\" | sort }}",
"[A B C]"
]
]
},
"Sort":{
"Description":"Sort returns a sorted sequence.",
"Args":[
"seq",
"args"
],
"Aliases":[
"sort"
],
"Examples":[]
},
"Union":{
"Description":"Union returns the union of the given sets, l1 and l2. l1 and\nl2 must be of the same type and may be either arrays or slices.\nIf l1 and l2 aren't of the same type then l1 will be returned.\nIf either l1 or l2 is nil then the non-nil list will be returned.",
"Args":[
"l1",
"l2"
],
"Aliases":[
"union"
],
"Examples":[
[
"{{ union (slice 1 2 3) (slice 3 4 5) }}",
"[1 2 3 4 5]"
]
]
},
"Uniq":{
"Description":"Uniq takes in a slice or array and returns a slice with subsequent\nduplicate elements removed.",
"Args":[
"l"
],
"Aliases":[
"uniq"
],
"Examples":[
[
"{{ slice 1 2 3 2 | uniq }}",
"[1 2 3]"
]
]
},
"Where":{
"Description":"Where returns a filtered subset of a given data type.",
"Args":[
"seq",
"key",
"args"
],
"Aliases":[
"where"
],
"Examples":[]
}
},
"crypto":{
"MD5":{
"Description":"MD5 hashes the given input and returns its MD5 checksum.",
"Args":[
"in"
],
"Aliases":[
"md5"
],
"Examples":[
[
"{{ md5 \"Hello world, gophers!\" }}",
"b3029f756f98f79e7f1b7f1d1f0dd53b"
],
[
"{{ crypto.MD5 \"Hello world, gophers!\" }}",
"b3029f756f98f79e7f1b7f1d1f0dd53b"
]
]
},
"SHA1":{
"Description":"SHA1 hashes the given input and returns its SHA1 checksum.",
"Args":[
"in"
],
"Aliases":[
"sha1"
],
"Examples":[
[
"{{ sha1 \"Hello world, gophers!\" }}",
"c8b5b0e33d408246e30f53e32b8f7627a7a649d4"
]
]
},
"SHA256":{
"Description":"SHA256 hashes the given input and returns its SHA256 checksum.",
"Description":"GetCSV expects a data separator and one or n-parts of a URL to a resource which\ncan either be a local or a remote one.\nThe data separator can be a comma, semi-colon, pipe, etc, but only one character.\nIf you provide multiple parts for the URL they will be joined together to the final URL.\nGetCSV returns nil or a slice slice to use in a short code.",
"Args":[
"sep",
"urlParts"
],
"Aliases":[
"getCSV"
],
"Examples":[]
},
"GetJSON":{
"Description":"GetJSON expects one or n-parts of a URL to a resource which can either be a local or a remote one.\nIf you provide multiple parts they will be joined together to the final URL.\nGetJSON returns nil or parsed JSON to use in a short code.",
"Args":[
"urlParts"
],
"Aliases":[
"getJSON"
],
"Examples":[]
}
},
"encoding":{
"Base64Decode":{
"Description":"Base64Decode returns the base64 decoding of the given content.",
"Args":[
"content"
],
"Aliases":[
"base64Decode"
],
"Examples":[
[
"{{ \"SGVsbG8gd29ybGQ=\" | base64Decode }}",
"Hello world"
],
[
"{{ 42 | base64Encode | base64Decode }}",
"42"
]
]
},
"Base64Encode":{
"Description":"Base64Encode returns the base64 encoding of the given content.",
"Args":[
"content"
],
"Aliases":[
"base64Encode"
],
"Examples":[
[
"{{ \"Hello world\" | base64Encode }}",
"SGVsbG8gd29ybGQ="
]
]
},
"Jsonify":{
"Description":"Jsonify encodes a given object to JSON.",
"Description":"Config returns the image.Config for the specified path relative to the\nworking directory.",
"Args":[
"path"
],
"Aliases":[
"imageConfig"
],
"Examples":[]
}
},
"inflect":{
"Humanize":{
"Description":"Humanize returns the humanized form of a single parameter.\n\nIf the parameter is either an integer or a string containing an integer\nvalue, the behavior is to add the appropriate ordinal.\n\n Example: \"my-first-post\" -\u003e \"My first post\"\n Example: \"103\" -\u003e \"103rd\"\n Example: 52 -\u003e \"52nd\"",
"Args":[
"in"
],
"Aliases":[
"humanize"
],
"Examples":[
[
"{{ humanize \"my-first-post\" }}",
"My first post"
],
[
"{{ humanize \"myCamelPost\" }}",
"My camel post"
],
[
"{{ humanize \"52\" }}",
"52nd"
],
[
"{{ humanize 103 }}",
"103rd"
]
]
},
"Pluralize":{
"Description":"Pluralize returns the plural form of a single word.",
"Args":[
"in"
],
"Aliases":[
"pluralize"
],
"Examples":[
[
"{{ \"cat\" | pluralize }}",
"cats"
]
]
},
"Singularize":{
"Description":"Singularize returns the singular form of a single word.",
"Args":[
"in"
],
"Aliases":[
"singularize"
],
"Examples":[
[
"{{ \"cats\" | singularize }}",
"cat"
]
]
}
},
"lang":{
"NumFmt":{
"Description":"NumFmt formats a number with the given precision using the\nnegative, decimal, and grouping options. The `options`\nparameter is a string consisting of `\u003cnegative\u003e \u003cdecimal\u003e \u003cgrouping\u003e`. The\ndefault `options` value is `- . ,`.\n\nNote that numbers are rounded up at 5 or greater.\nSo, with precision set to 0, 1.5 becomes `2`, and 1.4 becomes `1`.",
"Description":"Getenv retrieves the value of the environment variable named by the key.\nIt returns the value, which will be empty if the variable is not present.",
"Args":[
"key"
],
"Aliases":[
"getenv"
],
"Examples":[]
},
"ReadDir":{
"Description":"ReadDir lists the directory contents relative to the configured WorkingDir.",
"Args":[
"i"
],
"Aliases":[
"readDir"
],
"Examples":[
[
"{{ range (readDir \".\") }}{{ .Name }}{{ end }}",
"Description":"ReadFile reads the file named by filename relative to the configured WorkingDir.\nIt returns the contents as a string.\nThere is an upper size limit set at 1 megabytes.",
"Description":"Include executes the named partial and returns either a string,\nwhen the partial is a text/template, or template.HTML when html/template.",
"Description":"IncludeCached executes and caches partial templates. An optional variant\nstring parameter (a string slice actually, but be only use a variadic\nargument to make it optional) can be passed so that a given partial can have\nmultiple uses. The cache is created with name+variant as the key.",
"Description":"CountRunes returns the number of runes in s, excluding whitepace.",
"Args":[
"s"
],
"Aliases":[
"countrunes"
],
"Examples":[]
},
"CountWords":{
"Description":"CountWords returns the approximate word count in s.",
"Args":[
"s"
],
"Aliases":[
"countwords"
],
"Examples":[]
},
"FindRE":{
"Description":"FindRE returns a list of strings that match the regular expression. By default all matches\nwill be included. The number of matches can be limited with an optional third parameter.",
"Args":[
"expr",
"content",
"limit"
],
"Aliases":[
"findRE"
],
"Examples":[
[
"{{ findRE \"[G|g]o\" \"Hugo is a static side generator written in Go.\" \"1\" }}",
"[go]"
]
]
},
"HasPrefix":{
"Description":"HasPrefix tests whether the input s begins with prefix.",
"Args":[
"s",
"prefix"
],
"Aliases":[
"hasPrefix"
],
"Examples":[
[
"{{ hasPrefix \"Hugo\" \"Hu\" }}",
"true"
],
[
"{{ hasPrefix \"Hugo\" \"Fu\" }}",
"false"
]
]
},
"HasSuffix":{
"Description":"",
"Args":null,
"Aliases":null,
"Examples":null
},
"Replace":{
"Description":"Replace returns a copy of the string s with all occurrences of old replaced\nwith new.",
"Args":[
"s",
"old",
"new"
],
"Aliases":[
"replace"
],
"Examples":[
[
"{{ replace \"Batman and Robin\" \"Robin\" \"Catwoman\" }}",
"Batman and Catwoman"
]
]
},
"ReplaceRE":{
"Description":"ReplaceRE returns a copy of s, replacing all matches of the regular\nexpression pattern with the replacement text repl.",
"Args":[
"pattern",
"repl",
"s"
],
"Aliases":[
"replaceRE"
],
"Examples":[]
},
"SliceString":{
"Description":"SliceString slices a string by specifying a half-open range with\ntwo indices, start and end. 1 and 4 creates a slice including elements 1 through 3.\nThe end index can be omitted, it defaults to the string's length.",
"Args":[
"a",
"startEnd"
],
"Aliases":[
"slicestr"
],
"Examples":[
[
"{{slicestr \"BatMan\" 0 3}}",
"Bat"
],
[
"{{slicestr \"BatMan\" 3}}",
"Man"
]
]
},
"Split":{
"Description":"Split slices an input string into all substrings separated by delimiter.",
"Args":[
"a",
"delimiter"
],
"Aliases":[
"split"
],
"Examples":[]
},
"Substr":{
"Description":"Substr extracts parts of a string, beginning at the character at the specified\nposition, and returns the specified number of characters.\n\nIt normally takes two parameters: start and length.\nIt can also take one parameter: start, i.e. length is omitted, in which case\nthe substring starting from start until the end of the string will be returned.\n\nTo extract characters from the end of the string, use a negative start number.\n\nIn addition, borrowing from the extended behavior described at http://php.net/substr,\nif length is given and is negative, then that many characters will be omitted from\nthe end of string.",
"Args":[
"a",
"nums"
],
"Aliases":[
"substr"
],
"Examples":[
[
"{{substr \"BatMan\" 0 -3}}",
"Bat"
],
[
"{{substr \"BatMan\" 3 3}}",
"Man"
]
]
},
"Title":{
"Description":"Title returns a copy of the input s with all Unicode letters that begin words\nmapped to their title case.",
"Description":"Duration converts the given number to a time.Duration.\nUnit is one of nanosecond/ns, microsecond/us/µs, millisecond/ms, second/s, minute/m or hour/h.",
"Description":"Format converts the textual representation of the datetime string into\nthe other form or returns it of the time.Time value. These are formatted\nwith the layout string",
"Args":[
"layout",
"v"
],
"Aliases":[
"dateFormat"
],
"Examples":[
[
"dateFormat: {{ dateFormat \"Monday, Jan 2, 2006\" \"2015-01-21\" }}",
"dateFormat: Wednesday, Jan 21, 2015"
]
]
},
"Now":{
"Description":"Now returns the current local time.",
"Description":"ParseDuration parses a duration string.\nA duration string is a possibly signed sequence of\ndecimal numbers, each with optional fraction and a unit suffix,\nsuch as \"300ms\", \"-1.5h\" or \"2h45m\".\nValid time units are \"ns\", \"us\" (or \"µs\"), \"ms\", \"s\", \"m\", \"h\".\nSee https://golang.org/pkg/time/#ParseDuration",
"Description":"AbsLangURL takes a given string and converts it to an absolute URL according\nto a page's position in the project directory structure and the current\nlanguage.",
"Args":[
"a"
],
"Aliases":[
"absLangURL"
],
"Examples":[]
},
"AbsURL":{
"Description":"AbsURL takes a given string and converts it to an absolute URL.",
"Description":"Ref returns the absolute URL path to a given content item.",
"Args":[
"in",
"refs"
],
"Aliases":[
"ref"
],
"Examples":[]
},
"RelLangURL":{
"Description":"RelLangURL takes a given string and prepends the relative path according to a\npage's position in the project directory structure and the current language.",
"Args":[
"a"
],
"Aliases":[
"relLangURL"
],
"Examples":[]
},
"RelRef":{
"Description":"RelRef returns the relative URL path to a given content item.",
"Args":[
"in",
"refs"
],
"Aliases":[
"relref"
],
"Examples":[]
},
"RelURL":{
"Description":"RelURL takes a given string and prepends the relative path according to a\npage's position in the project directory structure.",