diff --git a/content/en/functions/hugo.md b/content/en/functions/hugo.md index 998c71c37..78d658c66 100644 --- a/content/en/functions/hugo.md +++ b/content/en/functions/hugo.md @@ -13,32 +13,35 @@ relatedfuncs: [] `hugo` returns an instance that contains the following functions: -hugo.Generator -: `` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `` +`hugo.BuildDate` +: (`string`) The compile date of the current Hugo binary formatted per [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) (e.g., `2023-05-23T08:14:20Z`). -hugo.Version -: the current version of the Hugo binary you are using e.g. `0.99.1` +`hugo.CommitHash` +: (`string`) The Git commit hash of the Hugo binary (e.g., `0a95d6704a8ac8d41cc5ca8fffaad8c5c7a3754a`). -hugo.GoVersion -: returns the version of Go that the Hugo binary was built with. {{< new-in "0.101.0" >}} +`hugo.Deps` +: (`[]*hugo.Dependency`) See [hugo.Deps](#hugodeps). -hugo.Environment -: the current running environment as defined through the `--environment` cli tag +`hugo.Environment` +: (`string`) The current running environment as defined through the `--environment` CLI flag (e.g., `development`, `production`). -hugo.CommitHash -: the git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247` +`hugo.Generator` +: (`template.HTML`) Renders an HTML `meta` element identifying the software that generated the site (e.g., ``). -hugo.BuildDate -: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00` +`hugo.GoVersion` +: (`string`) The Go version used to compile the Hugo binary (e.g., `go1.20.4`). {{< new-in "0.101.0" >}} -hugo.IsExtended -: whether this is the extended Hugo binary. +`hugo.IsExtended` +: (`bool`) Returns `true` if the Hugo binary is the extended version. -hugo.IsProduction -: returns true if `hugo.Environment` is set to the production environment +`hugo.IsProduction` +: (`bool`) Returns `true` if `hugo.Environment` is set to the production environment. -hugo.Deps -: See [hugo.Deps](#hugodeps) +`hugo.Version` +: (`hugo.VersionString`) The current version of the Hugo binary (e.g., `0.112.1`). + +`hugo.WorkingDir` +: (`string`) The project working directory (e.g., `/home/user/projects/my-hugo-site`). {{< new-in "0.112.0" >}} ## hugo.Deps @@ -48,28 +51,28 @@ hugo.Deps Each dependency contains: -Path (string) -: Returns the path to this module. This will either be the module path, e.g. "github.com/gohugoio/myshortcodes", or the path below your /theme folder, e.g. "mytheme". - -Version (string) -: The module version. - -Vendor (bool) -: Whether this dependency is vendored. - -Time (time.Time) -: Time version was created. - Owner -: In the dependency tree, this is the first module that defines this module as a dependency. +: (`*hugo.Dependency`) In the dependency tree, this is the first module that defines this module as a dependency (e.g., `github.com/gohugoio/hugo-mod-bootstrap-scss/v5`). -Replace (*Dependency) -: Replaced by this dependency. +Path +: (`string`) The module path or the path below your `themes` directory (e.g., `github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2`). + +Replace +: (`*hugo.Dependency`) Replaced by this dependency. + +Time +: (`time.Time`) The time that the version was created (e.g., `2022-02-13 15:11:28 +0000 UTC`). + +Vendor +: (`bool`) Returns `true` if the dependency is vendored. + +Version +: (`string`) The module version (e.g., `v2.21100.20000`). An example table listing the dependencies: ```html -

Dependencies

+

Dependencies