summaryrefslogtreecommitdiffstats
path: root/docs/content/en/functions
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-27 17:02:23 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-27 17:02:23 +0200
commita838a27e4c82626f9b3227e02a157119673e5dcf (patch)
tree9d220eadc3fcaedfd77be3fa466fec14e038cfd1 /docs/content/en/functions
parent273d9f69a6cb46ce632b340ebb1191e2e083323b (diff)
parentd3927310d5b2404c3238f9b899db3329ea516490 (diff)
Diffstat (limited to 'docs/content/en/functions')
-rw-r--r--docs/content/en/functions/hugo.md65
-rw-r--r--docs/content/en/functions/param.md2
-rw-r--r--docs/content/en/functions/safeHTML.md4
-rw-r--r--docs/content/en/functions/safeHTMLAttr.md2
-rw-r--r--docs/content/en/functions/safeURL.md4
-rw-r--r--docs/content/en/functions/sort.md4
-rw-r--r--docs/content/en/functions/where.md2
7 files changed, 43 insertions, 40 deletions
diff --git a/docs/content/en/functions/hugo.md b/docs/content/en/functions/hugo.md
index 998c71c37..78d658c66 100644
--- a/docs/content/en/functions/hugo.md
+++ b/docs/content/en/functions/hugo.md
@@ -13,32 +13,35 @@ relatedfuncs: []
`hugo` returns an instance that contains the following functions:
-hugo.Generator
-: `<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">`
+`hugo.BuildDate`
+: (`string`) The compile date of the current Hugo binary formatted per [RFC&nbsp;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., `<meta name="generator" content="Hugo 0.112.0">`).
-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".
+Owner
+: (`*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`).
-Version (string)
-: The module version.
+Path
+: (`string`) The module path or the path below your `themes` directory (e.g., `github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2`).
-Vendor (bool)
-: Whether this dependency is vendored.
+Replace
+: (`*hugo.Dependency`) Replaced by this dependency.
-Time (time.Time)
-: Time version was created.
+Time
+: (`time.Time`) The time that the version was created (e.g., `2022-02-13 15:11:28 +0000 UTC`).
-Owner
-: In the dependency tree, this is the first module that defines this module as a dependency.
+Vendor
+: (`bool`) Returns `true` if the dependency is vendored.
-Replace (*Dependency)
-: Replaced by this dependency.
+Version
+: (`string`) The module version (e.g., `v2.21100.20000`).
An example table listing the dependencies:
```html
- <h2>Dependencies</h2>
+<h2>Dependencies</h2>
<table class="table table-dark">
<thead>
<tr>
diff --git a/docs/content/en/functions/param.md b/docs/content/en/functions/param.md
index c01bf4a91..45ef4434c 100644
--- a/docs/content/en/functions/param.md
+++ b/docs/content/en/functions/param.md
@@ -17,7 +17,7 @@ For example, to show a table of contents on every page, but allow authors to hid
**Configuration**
-{{< code-toggle file="config" copy=false >}}
+{{< code-toggle file="hugo" copy=false >}}
[params]
display_toc = true
{{< /code-toggle >}}
diff --git a/docs/content/en/functions/safeHTML.md b/docs/content/en/functions/safeHTML.md
index 182633e46..4e74b44d4 100644
--- a/docs/content/en/functions/safeHTML.md
+++ b/docs/content/en/functions/safeHTML.md
@@ -12,9 +12,9 @@ relatedfuncs: []
It should not be used for HTML from a third-party, or HTML with unclosed tags or comments.
-Given a site-wide [`config.toml`][config] with the following `copyright` value:
+Given a site-wide [`hugo.toml`][config] with the following `copyright` value:
-{{< code-toggle file="config" >}}
+{{< code-toggle file="hugo" >}}
copyright = "© 2015 Jane Doe. <a href=\"https://creativecommons.org/licenses/by/4.0/\">Some rights reserved</a>."
{{< /code-toggle >}}
diff --git a/docs/content/en/functions/safeHTMLAttr.md b/docs/content/en/functions/safeHTMLAttr.md
index 8d1d7efbc..ac7f32d7a 100644
--- a/docs/content/en/functions/safeHTMLAttr.md
+++ b/docs/content/en/functions/safeHTMLAttr.md
@@ -12,7 +12,7 @@ relatedfuncs: []
Given a site configuration that contains this menu entry:
-{{< code-toggle file="config" >}}
+{{< code-toggle file="hugo" >}}
[[menu.main]]
name = "IRC"
url = "irc://irc.freenode.net/#golang"
diff --git a/docs/content/en/functions/safeURL.md b/docs/content/en/functions/safeURL.md
index 4d517bd1e..b21de4953 100644
--- a/docs/content/en/functions/safeURL.md
+++ b/docs/content/en/functions/safeURL.md
@@ -14,9 +14,9 @@ relatedfuncs: []
Without `safeURL`, only the URI schemes `http:`, `https:` and `mailto:` are considered safe by Go templates. If any other URI schemes (e.g., `irc:` and `javascript:`) are detected, the whole URL will be replaced with `#ZgotmplZ`. This is to "defang" any potential attack in the URL by rendering it useless.
-The following examples use a [site `config.toml`][configuration] with the following [menu entry][menus]:
+The following examples use a [site `hugo.toml`][configuration] with the following [menu entry][menus]:
-{{< code-toggle file="config" copy=false >}}
+{{< code-toggle file="hugo" copy=false >}}
[[menu.main]]
name = "IRC: #golang at freenode"
url = "irc://irc.freenode.net/#golang"
diff --git a/docs/content/en/functions/sort.md b/docs/content/en/functions/sort.md
index fc147c9fb..aa15f5cd6 100644
--- a/docs/content/en/functions/sort.md
+++ b/docs/content/en/functions/sort.md
@@ -18,7 +18,7 @@ The `ORDER` may be either `asc` (ascending) or `desc` (descending). The default
The examples below assume this site configuration:
-{{< code-toggle file="config" copy=false >}}
+{{< code-toggle file="hugo" copy=false >}}
[params]
grades = ['b','a','c']
{{< /code-toggle >}}
@@ -48,7 +48,7 @@ In the example above, `value` is the `KEY` representing the value of the slice e
The examples below assume this site configuration:
-{{< code-toggle file="config" copy=false >}}
+{{< code-toggle file="hugo" copy=false >}}
[params.authors.a]
firstName = "Marius"
lastName = "Pontmercy"
diff --git a/docs/content/en/functions/where.md b/docs/content/en/functions/where.md
index 49882b807..871d04e9b 100644
--- a/docs/content/en/functions/where.md
+++ b/docs/content/en/functions/where.md
@@ -158,7 +158,7 @@ will default to the *section with the most pages*.
The user can override the default:
-{{< code-toggle file="config" >}}
+{{< code-toggle file="hugo" >}}
[params]
mainSections = ["blog", "docs"]
{{< /code-toggle >}}