mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 00:16:45 +00:00
common/hugo: Add hugo.IsServer and hugo.IsDevelopment
And deprecate site.IsServer. Closes #11510
This commit is contained in:
1 parent
f864af97a0
commit
e3ec2a4f20
2 files changed
+7
-4
No files matched your search
@@ -31,11 +31,17 @@ relatedfuncs: []
|
|||||||
`hugo.GoVersion`
|
`hugo.GoVersion`
|
||||||
: (`string`) The Go version used to compile the Hugo binary (e.g., `go1.20.4`). {{< new-in "0.101.0" >}}
|
: (`string`) The Go version used to compile the Hugo binary (e.g., `go1.20.4`). {{< new-in "0.101.0" >}}
|
||||||
|
|
||||||
|
`hugo.IsDevelopment`
|
||||||
|
: (`bool`) Returns `true` if `hugo.Environment` is "development".
|
||||||
|
|
||||||
`hugo.IsExtended`
|
`hugo.IsExtended`
|
||||||
: (`bool`) Returns `true` if the Hugo binary is the extended version.
|
: (`bool`) Returns `true` if the Hugo binary is the extended version.
|
||||||
|
|
||||||
`hugo.IsProduction`
|
`hugo.IsProduction`
|
||||||
: (`bool`) Returns `true` if `hugo.Environment` is set to the production environment.
|
: (`bool`) Returns `true` if `hugo.Environment` is "production".
|
||||||
|
|
||||||
|
`hugo.IsServer`
|
||||||
|
: (`bool`) Returns `true` if the site is being served with Hugo's built-in server.
|
||||||
|
|
||||||
`hugo.Version`
|
`hugo.Version`
|
||||||
: (`hugo.VersionString`) The current version of the Hugo binary (e.g., `0.112.1`).
|
: (`hugo.VersionString`) The current version of the Hugo binary (e.g., `0.112.1`).
|
||||||
|
|||||||
@@ -47,9 +47,6 @@ All the methods below, e.g. `.Site.RegularPages` can also be reached via the glo
|
|||||||
.Site.IsMultiLingual
|
.Site.IsMultiLingual
|
||||||
: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
|
: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
|
||||||
|
|
||||||
.Site.IsServer
|
|
||||||
: a boolean to indicate if the site is being served with Hugo's built-in server. See [`hugo server`](/commands/hugo_server/) for more information.
|
|
||||||
|
|
||||||
.Site.Language.Lang
|
.Site.Language.Lang
|
||||||
: the language code of the current locale (e.g., `en`).
|
: the language code of the current locale (e.g., `en`).
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user