Parses the image and returns the height, width, and color model.
Cliquez pour lire plus »
.AddDate
Returns the time corresponding to adding the given number of years, months, and days passed to the function.
Cliquez pour lire plus »
.Format
Formats built-in Hugo dates—
.Date, .PublishDate, and .LastMod—according to Go’s layout string.
Cliquez pour lire plus »
.Get
Accesses positional and ordered parameters in shortcode declaration.
Cliquez pour lire plus »
.Param
Calls page or site variables into your template.
Cliquez pour lire plus »
.Scratch
Agis comme un “scratchpad” pour autoriser les variables pouvant être écrites dans la page ou le shortcode.
Cliquez pour lire plus »
.Unix
.Unix returns the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC.
Cliquez pour lire plus »
Math
Hugo provides six mathematical operators in templates.
Cliquez pour lire plus »
absLangURL
Adds the absolute URL with correct language prefix according to site configuration for multilingual.
Cliquez pour lire plus »
absURL
Creates an absolute URL based on the configured baseURL.
Cliquez pour lire plus »
after
after slices an array to only the items after the Nth item.
Cliquez pour lire plus »
apply
Given a map, array, or slice,
apply returns a new slice with a function applied over it.
Cliquez pour lire plus »
base64
base64Encode and base64Decode let you easily decode content with a base64 encoding and vice versa through pipes.
Cliquez pour lire plus »
chomp
Removes any trailing newline characters.
Cliquez pour lire plus »
countrunes
Determines the number of runes in a string excluding any whitespace.
Cliquez pour lire plus »
countwords
Counts the number of words in a string.
Cliquez pour lire plus »
dateFormat
Converts the textual representation of the
datetime into the specified format.
Cliquez pour lire plus »
default
Allows setting a default value that can be returned if a first value is not set.
Cliquez pour lire plus »
delimit
Loops through any array, slice, or map and returns a string of all the values separated by a delimiter.
Cliquez pour lire plus »
dict
Creates a dictionary from a list of key and value pairs.
Cliquez pour lire plus »
echoParam
Prints a parameter if it is set.
Cliquez pour lire plus »
emojify
Lance une chaîne dans le processeur d’émoticônes Emoji.
Cliquez pour lire plus »
eq
Returns true if the parameters are equal.
Cliquez pour lire plus »
findRE
Returns a list of strings that match the regular expression.
Cliquez pour lire plus »
first
Slices an array to only the first N elements.
Cliquez pour lire plus »
getenv
Returns the value of an environment variable.
Cliquez pour lire plus »
hasprefix
Tests whether a string begins with prefix.
Cliquez pour lire plus »
highlight
Takes a string of code and language declaration and uses Pygments to return syntax-highlighted HTML with inline-styles.
Cliquez pour lire plus »
htmlEscape
Returns the given string with the reserved HTML codes escaped.
Cliquez pour lire plus »
htmlUnescape
Returns the given string with HTML escape codes un-escaped.
Cliquez pour lire plus »
humanize
Returns the humanized version of an argument with the first letter capitalized.
Cliquez pour lire plus »
i18n
Traduit un morceau de contenu basé sur vos fichiers de configuration i18n.
Cliquez pour lire plus »
in
Checks if an element is in an array or slice–or a substring in a string—and returns a boolean.
Cliquez pour lire plus »
index
Looks up the index(es) or key(s) of the data structure passed into it.
Cliquez pour lire plus »
int
Creates an
int from the argument passed into the function.
Cliquez pour lire plus »
intersect
Returns the common elements of two arrays or slices.
Cliquez pour lire plus »
isset
Returns true if the parameter is set.
Cliquez pour lire plus »
jsonify
Encodes a given object to JSON.
Cliquez pour lire plus »
lang.NumFmt
Formats a number with a given precision using the requested
decimal, grouping, and negative characters.
Cliquez pour lire plus »
last
slices an array to only the last Nth elements.
Cliquez pour lire plus »
len
Returns the length of a variable according to its type.
Cliquez pour lire plus »
lower
Converts all characters in the provided string to lowercase.
Cliquez pour lire plus »
markdownify
Runs the provided string through the Markdown processor.
Cliquez pour lire plus »
md5
hashes the given input and returns its MD5 checksum.
Cliquez pour lire plus »
now
Returns the current local time
Cliquez pour lire plus »
partialCached
Allows for caching of partials that do not need to be re-rendered on every invocation.
Cliquez pour lire plus »
plainify
Strips any HTML and returns the plain text version of the provided string.
Cliquez pour lire plus »
pluralize
Pluralizes the given word according to a set of common English pluralization rules
Cliquez pour lire plus »
printf
Formats a string using the standard
fmt.Sprintf function.
Cliquez pour lire plus »
querify
Takes a set of key-value pairs and returns a query string to be appended to URLs.
Cliquez pour lire plus »
range
Iterates over a map, array, or slice.
Cliquez pour lire plus »
readDir
Gets a directory listing from a directory relative to the current working directory.
Cliquez pour lire plus »
readFile
Reads a file from disk relative to the current project working directory and returns a string.
Cliquez pour lire plus »
ref
Looks up a content page by logical name.
Cliquez pour lire plus »
relLangURL
Adds the relative URL with correct language prefix according to site configuration for multilingual.
Cliquez pour lire plus »
relURL
Given a string, prepends the relative URL according to a page’s position in the project directory structure.
Cliquez pour lire plus »
relref
Looks up a content page by relative path.
Cliquez pour lire plus »
render
Takes a view to apply when rendering content.
Cliquez pour lire plus »
replace
Replaces all occurrences of the search string with the replacement string.
Cliquez pour lire plus »
replacere
Replaces all occurrences of a regular expression with the replacement pattern.
Cliquez pour lire plus »
safeCSS
Declares the provided string as a known “safe” CSS string.
Cliquez pour lire plus »
safeHTML
Declares a provided string as a “safe” HTML document to avoid escaping by Go templates.
Cliquez pour lire plus »
safeHTMLAttr
Declares the provided string as a safe HTML attribute.
Cliquez pour lire plus »
safeJS
Declares the provided string as a known safe JavaScript string.
Cliquez pour lire plus »
safeURL
Declares the provided string as a safe URL or URL substring.
Cliquez pour lire plus »
seq
Creates a sequence of integers.
Cliquez pour lire plus »
sha
Hashes the given input and returns either an SHA1 or SHA256 checksum.
Cliquez pour lire plus »
shuffle
Returns a random permutation of a given array or slice.
Cliquez pour lire plus »
singularize
Converts a word according to a set of common English singularization rules.
Cliquez pour lire plus »
slice
Creates a alice (array) of all passed arguments.
Cliquez pour lire plus »
slicestr
Creates a slice of a half-open range, including start and end indices.
Cliquez pour lire plus »
sort
Sorts maps, arrays, and slices and returns a sorted slice.
Cliquez pour lire plus »
split
splits a string into substrings separated by a delimiter
Cliquez pour lire plus »
string
Creates a string from the argument passed to the function
Cliquez pour lire plus »
substr
Extracts parts of a string from a specified character’s position and returns the specified number of characters.
Cliquez pour lire plus »
time
Converts a timestamp string into a
time.Time structure.
Cliquez pour lire plus »
title
Converts all characters in the provided string to title case.
Cliquez pour lire plus »
trim
Returns a slice of a passed string with all leading and trailing characters from cutset removed.
Cliquez pour lire plus »
truncate
Truncates a text to a max length without cutting words or leaving unclosed HTML tags.
Cliquez pour lire plus »
union
Given two arrays or slices, returns a new array that contains the elements or objects that belong to either or both arrays/slices.
Cliquez pour lire plus »
uniq
Takes in a slice or array and returns a slice with subsequent duplicate elements removed.
Cliquez pour lire plus »
upper
Converts all characters in a string to uppercase
Cliquez pour lire plus »
urlize
Takes a string, sanitizes it for usage in URLs, and converts spaces to hyphens.
Cliquez pour lire plus »
where
Filters an array to only the elements containing a matching value for a given field.
Cliquez pour lire plus »
with
Rebinds the context (
.) within its scope and skips the block if the variable is absent.
Cliquez pour lire plus »