mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 08:18:30 +00:00
Add hugo.WorkingDir to docs (#2089)
This commit is contained in:
1 parent
7487df8095
commit
d489d4c6f7
1 file changed
+37
-34
@@ -13,32 +13,35 @@ relatedfuncs: []
|
|||||||
|
|
||||||
`hugo` returns an instance that contains the following functions:
|
`hugo` returns an instance that contains the following functions:
|
||||||
|
|
||||||
hugo.Generator
|
`hugo.BuildDate`
|
||||||
: `<meta>` tag for the version of Hugo that generated the site. `hugo.Generator` outputs a *complete* HTML tag; e.g. `<meta name="generator" content="Hugo 0.63.2">`
|
: (`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
|
`hugo.CommitHash`
|
||||||
: the current version of the Hugo binary you are using e.g. `0.99.1`
|
: (`string`) The Git commit hash of the Hugo binary (e.g., `0a95d6704a8ac8d41cc5ca8fffaad8c5c7a3754a`).
|
||||||
|
|
||||||
hugo.GoVersion
|
`hugo.Deps`
|
||||||
: returns the version of Go that the Hugo binary was built with. {{< new-in "0.101.0" >}}
|
: (`[]*hugo.Dependency`) See [hugo.Deps](#hugodeps).
|
||||||
|
|
||||||
hugo.Environment
|
`hugo.Environment`
|
||||||
: the current running environment as defined through the `--environment` cli tag
|
: (`string`) The current running environment as defined through the `--environment` CLI flag (e.g., `development`, `production`).
|
||||||
|
|
||||||
hugo.CommitHash
|
`hugo.Generator`
|
||||||
: the git commit hash of the current Hugo binary e.g. `0e8bed9ccffba0df554728b46c5bbf6d78ae5247`
|
: (`template.HTML`) Renders an HTML `meta` element identifying the software that generated the site (e.g., `<meta name="generator" content="Hugo 0.112.0">`).
|
||||||
|
|
||||||
hugo.BuildDate
|
`hugo.GoVersion`
|
||||||
: the compile date of the current Hugo binary formatted with RFC 3339 e.g. `2002-10-02T10:00:00-05:00`
|
: (`string`) The Go version used to compile the Hugo binary (e.g., `go1.20.4`). {{< new-in "0.101.0" >}}
|
||||||
|
|
||||||
hugo.IsExtended
|
`hugo.IsExtended`
|
||||||
: whether this is the extended Hugo binary.
|
: (`bool`) Returns `true` if the Hugo binary is the extended version.
|
||||||
|
|
||||||
hugo.IsProduction
|
`hugo.IsProduction`
|
||||||
: returns true if `hugo.Environment` is set to the production environment
|
: (`bool`) Returns `true` if `hugo.Environment` is set to the production environment.
|
||||||
|
|
||||||
hugo.Deps
|
`hugo.Version`
|
||||||
: See [hugo.Deps](#hugodeps)
|
: (`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
|
## hugo.Deps
|
||||||
|
|
||||||
@@ -48,28 +51,28 @@ hugo.Deps
|
|||||||
|
|
||||||
Each dependency contains:
|
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
|
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)
|
Path
|
||||||
: Replaced by this dependency.
|
: (`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:
|
An example table listing the dependencies:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<h2>Dependencies</h2>
|
<h2>Dependencies</h2>
|
||||||
<table class="table table-dark">
|
<table class="table table-dark">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in new issue
Block a user