mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-16 11:14:41 -04:00
Fixing typos, fixing incomplete link (#1561)
This commit is contained in:
parent
c78cc014b5
commit
cf8627c2e6
@ -65,7 +65,7 @@ audio
|
|||||||
: an array of paths to audio files related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:audio`.
|
: an array of paths to audio files related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:audio`.
|
||||||
|
|
||||||
cascade
|
cascade
|
||||||
: a map of Front Matter keys whose values are passed down to the page's descendents unless overwritten by self or a closer ancestor's cascade. See [Front Matter Cascade](#front-matter-cascade) for details.
|
: a map of Front Matter keys whose values are passed down to the page's descendants unless overwritten by self or a closer ancestor's cascade. See [Front Matter Cascade](#front-matter-cascade) for details.
|
||||||
|
|
||||||
date
|
date
|
||||||
: the datetime assigned to this page. This is usually fetched from the `date` field in front matter, but this behaviour is configurable.
|
: the datetime assigned to this page. This is usually fetched from the `date` field in front matter, but this behaviour is configurable.
|
||||||
@ -156,7 +156,7 @@ show_comments: false
|
|||||||
|
|
||||||
## Front Matter Cascade
|
## Front Matter Cascade
|
||||||
|
|
||||||
Any node or section can pass down to descendents a set of Front Matter values as long as defined underneath the reserved `cascade` Front Matter key.
|
Any node or section can pass down to descendants a set of Front Matter values as long as defined underneath the reserved `cascade` Front Matter key.
|
||||||
|
|
||||||
### Target Specific Pages
|
### Target Specific Pages
|
||||||
|
|
||||||
@ -201,9 +201,9 @@ cascade:
|
|||||||
banner: images/typewriter.jpg
|
banner: images/typewriter.jpg
|
||||||
{{</ code-toggle >}}
|
{{</ code-toggle >}}
|
||||||
|
|
||||||
With the above example the Blog section page and its descendents will return `images/typewriter.jpg` when `.Params.banner` is invoked unless:
|
With the above example the Blog section page and its descendants will return `images/typewriter.jpg` when `.Params.banner` is invoked unless:
|
||||||
|
|
||||||
- Said descendent has its own `banner` value set
|
- Said descendant has its own `banner` value set
|
||||||
- Or a closer ancestor node has its own `cascade.banner` value set.
|
- Or a closer ancestor node has its own `cascade.banner` value set.
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ aliases: []
|
|||||||
`.GetPage` returns a page of a given `path`. Both `Site` and `Page` implements this method. The `Page` variant will, if given a relative path -- i.e. a path without a leading `/` -- try look for the page relative to the current page.
|
`.GetPage` returns a page of a given `path`. Both `Site` and `Page` implements this method. The `Page` variant will, if given a relative path -- i.e. a path without a leading `/` -- try look for the page relative to the current page.
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
**Note:** We overhauled and simplified the `.GetPage` API in Hugo 0.45. Before that you needed to provide a `Kind` attribute in addition to the path, e.g. `{{ .Site.GetPage "section" "blog" }}`. This will still work, but is now superflous.
|
**Note:** We overhauled and simplified the `.GetPage` API in Hugo 0.45. Before that you needed to provide a `Kind` attribute in addition to the path, e.g. `{{ .Site.GetPage "section" "blog" }}`. This will still work, but is now superfluous.
|
||||||
{{% /note %}}
|
{{% /note %}}
|
||||||
|
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ aliases: []
|
|||||||
{{ with .Site.GetPage "/blog" }}{{ .Title }}{{ end }}
|
{{ with .Site.GetPage "/blog" }}{{ .Title }}{{ end }}
|
||||||
```
|
```
|
||||||
|
|
||||||
This method wil return `nil` when no page could be found, so the above will not print anything if the blog section is not found.
|
This method will return `nil` when no page could be found, so the above will not print anything if the blog section is not found.
|
||||||
|
|
||||||
To find a regular page in the blog section::
|
To find a regular page in the blog section::
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ aliases: []
|
|||||||
|
|
||||||
`dict` is especially useful for passing more than one value to a partial template.
|
`dict` is especially useful for passing more than one value to a partial template.
|
||||||
|
|
||||||
Note that the `key` can be either a `string` or a `string slice`. The latter is useful to create a deply nested structure, e.g.:
|
Note that the `key` can be either a `string` or a `string slice`. The latter is useful to create a deeply nested structure, e.g.:
|
||||||
|
|
||||||
```go-text-template
|
```go-text-template
|
||||||
{{ $m := dict (slice "a" "b" "c") "value" }}
|
{{ $m := dict (slice "a" "b" "c") "value" }}
|
||||||
|
@ -22,7 +22,7 @@ It normally takes two parameters: `start` and `length`. It can also take one par
|
|||||||
|
|
||||||
To extract characters from the end of the string, use a negative start number.
|
To extract characters from the end of the string, use a negative start number.
|
||||||
|
|
||||||
In addition, borrowing from the extended behavior described at https://php.net substr, if `length` is given and is negative, that number of characters will be omitted from the end of string.
|
If `length` is given and is negative, that number of characters will be omitted from the end of string.
|
||||||
|
|
||||||
```
|
```
|
||||||
{{ substr "abcdef" 0 }} → "abcdef"
|
{{ substr "abcdef" 0 }} → "abcdef"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user