函数速查
按命名空间分组的 Hugo 函数速查;函数别名(若有)标注在名称右侧。
下表按命名空间列出全部函数。名称右侧括号内为别名(若有)。
cast
- cast.ToFloat (float)
- cast.ToInt (int)
- cast.ToString (string)
collections
- collections.After (after)
- collections.Append (append)
- collections.Apply (apply)
- collections.Complement (complement)
- collections.D
- collections.Delimit (delimit)
- collections.Dictionary (dict)
- collections.First (first)
- collections.Group (group)
- collections.In (in)
- collections.Index (index)
- collections.Intersect (intersect)
- collections.IsSet (isset)
- collections.KeyVals (keyVals)
- collections.Last (last)
- collections.Merge (merge)
- collections.NewScratch (newScratch)
- collections.Querify (querify)
- collections.Reverse
- collections.Seq (seq)
- collections.Shuffle (shuffle)
- collections.Slice (slice)
- collections.Sort (sort)
- collections.SymDiff (symdiff)
- collections.Union (union)
- collections.Uniq (uniq)
- collections.Where (where)
compare
- compare.Conditional (cond)
- compare.Default (default)
- compare.Eq (eq)
- compare.Ge (ge)
- compare.Gt (gt)
- compare.Le (le)
- compare.Lt (lt)
- compare.Ne (ne)
crypto
- crypto.Hash
- crypto.HMAC (hmac)
- crypto.MD5 (md5)
- crypto.SHA1 (sha1)
- crypto.SHA256 (sha256)
css
- css.Build
- css.ChromaStyles
- css.PostCSS (postCSS)
- css.Quoted
- css.Sass (toCSS)
- css.TailwindCSS
- css.Unquoted
debug
diagrams
encoding
- encoding.Base64Decode (base64Decode)
- encoding.Base64Encode (base64Encode)
- encoding.HexDecode
- encoding.HexEncode
- encoding.Jsonify (jsonify)
fmt
- fmt.Errorf (errorf)
- fmt.Erroridf (erroridf)
- fmt.Print (print)
- fmt.Printf (printf)
- fmt.Println (println)
- fmt.Warnf (warnf)
- fmt.Warnidf (warnidf)
global
go template
hash
- hash.FNV32a
- hash.XxHash (xxhash)
hugo
- hugo.BuildDate
- hugo.CommitHash
- hugo.Data
- hugo.Deps
- hugo.Environment
- hugo.Generator
- hugo.GoVersion
- hugo.IsDevelopment
- hugo.IsExtended
- hugo.IsMultihost
- hugo.IsMultilingual
- hugo.IsProduction
- hugo.IsServer
- hugo.Sites
- hugo.Store
- hugo.Version
- hugo.WorkingDir
images
- images.AutoOrient
- images.Brightness
- images.ColorBalance
- images.Colorize
- images.Config
- images.Contrast
- images.Dither
- images.Filter
- images.Gamma
- images.GaussianBlur
- images.Grayscale
- images.Hue
- images.Invert
- images.Mask
- images.Opacity
- images.Overlay
- images.Padding
- images.Pixelate
- images.Process
- images.QR
- images.Saturation
- images.Sepia
- images.Sigmoid
- images.Text
- images.UnsharpMask
inflect
- inflect.Humanize (humanize)
- inflect.Pluralize (pluralize)
- inflect.Singularize (singularize)
js
lang
- lang.FormatAccounting
- lang.FormatCurrency
- lang.FormatNumber
- lang.FormatNumberCustom
- lang.FormatPercent
- lang.Merge
- lang.Translate (T、i18n)
math
- math.Abs
- math.Acos
- math.Add (add)
- math.Asin
- math.Atan
- math.Atan2
- math.Ceil
- math.Cos
- math.Counter
- math.Div (div)
- math.Floor
- math.Log
- math.Max
- math.MaxInt64
- math.Min
- math.Mod (mod)
- math.ModBool (modBool)
- math.Mul (mul)
- math.Pi
- math.Pow (pow)
- math.Product
- math.Rand
- math.Round
- math.Sin
- math.Sqrt
- math.Sub (sub)
- math.Sum
- math.Tan
- math.ToDegrees
- math.ToRadians
openapi3
os
- os.FileExists (fileExists)
- os.Getenv (getenv)
- os.ReadDir (readDir)
- os.ReadFile (readFile)
- os.Stat
partials
- partials.Include (partial)
- partials.IncludeCached (partialCached)
path
reflect
- reflect.IsImageResource
- reflect.IsImageResourceProcessable
- reflect.IsImageResourceWithMeta
- reflect.IsMap
- reflect.IsPage
- reflect.IsResource
- reflect.IsSite
- reflect.IsSlice
resources
- resources.ByType
- resources.Concat
- resources.Copy
- resources.ExecuteAsTemplate
- resources.Fingerprint (fingerprint)
- resources.FromString
- resources.Get
- resources.GetMatch
- resources.GetRemote
- resources.Match
- resources.Minify (minify)
- resources.PostProcess
- resources.Publish
safe
- safe.CSS (safeCSS)
- safe.HTML (safeHTML)
- safe.HTMLAttr (safeHTMLAttr)
- safe.JS (safeJS)
- safe.JSStr (safeJSStr)
- safe.URL (safeURL)
strings
- strings.Chomp (chomp)
- strings.Contains
- strings.ContainsAny
- strings.ContainsNonSpace
- strings.Count
- strings.CountRunes (countrunes)
- strings.CountWords (countwords)
- strings.Diff
- strings.FindRE (findRE)
- strings.FindRESubmatch (findRESubmatch)
- strings.FirstLower
- strings.FirstUpper
- strings.HasPrefix (hasPrefix)
- strings.HasSuffix (hasSuffix)
- strings.Repeat
- strings.Replace (replace)
- strings.ReplacePairs
- strings.ReplaceRE (replaceRE)
- strings.RuneCount
- strings.SliceString (slicestr)
- strings.Split (split)
- strings.Substr (substr)
- strings.Title (title)
- strings.ToLower (lower)
- strings.ToUpper (upper)
- strings.Trim (trim)
- strings.TrimLeft
- strings.TrimPrefix
- strings.TrimRight
- strings.TrimSpace
- strings.TrimSuffix
- strings.Truncate (truncate)
templates
time
- time.AsTime (time)
- time.Duration (duration)
- time.Format (dateFormat)
- time.In
- time.Now (now)
- time.ParseDuration
transform
- transform.CanHighlight
- transform.Emojify (emojify)
- transform.Highlight (highlight)
- transform.HighlightCodeBlock
- transform.HTMLEscape (htmlEscape)
- transform.HTMLToMarkdown
- transform.HTMLUnescape (htmlUnescape)
- transform.Markdownify (markdownify)
- transform.Plainify (plainify)
- transform.PortableText
- transform.Remarshal
- transform.ToMath
- transform.Unmarshal (unmarshal)
- transform.XMLEscape
urls
- urls.AbsLangURL (absLangURL)
- urls.AbsURL (absURL)
- urls.Anchorize (anchorize)
- urls.JoinPath
- urls.Parse
- urls.PathEscape
- urls.PathUnescape
- urls.Ref (ref)
- urls.RelLangURL (relLangURL)
- urls.RelRef (relref)
- urls.RelURL (relURL)
- urls.URLize (urlize)