mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-17 18:04:38 -04:00
Replace erroneous use of nocopy shortcode param
This commit is contained in:
parent
064896c06e
commit
ac333c7954
@ -51,7 +51,7 @@ Both of the above `default` function calls return `Roboto`.
|
||||
|
||||
A `default` value, however, does not need to be hard coded like the previous example. The `default` value can be a variable or pulled directly from the front matter using dot notation:
|
||||
|
||||
{{< code file="variable-as-default-value.html" nocopy="true" >}}
|
||||
{{< code file="variable-as-default-value.html" copy="false" >}}
|
||||
{{$old := .Params.oldparam }}
|
||||
<p>{{ .Params.newparam | default $old }}</p>
|
||||
{{< /code >}}
|
||||
@ -78,14 +78,14 @@ The following have equivalent return values but are far less terse. This demonst
|
||||
|
||||
Using `if`:
|
||||
|
||||
{{< code file="if-instead-of-default.html" nocopy="true" >}}
|
||||
{{< code file="if-instead-of-default.html" copy="false" >}}
|
||||
<title>{{if .Params.seo_title}}{{.Params.seo_title}}{{else}}{{.Title}}{{end}}</title>
|
||||
=> Sane Defaults
|
||||
{{< /code >}}
|
||||
|
||||
Using `with`:
|
||||
|
||||
{{< code file="with-instead-of-default.html" nocopy="true" >}}
|
||||
{{< code file="with-instead-of-default.html" copy="false" >}}
|
||||
<title>{{with .Params.seo_title}}{{.}}{{else}}{{.Title}}{{end}}</title>
|
||||
=> Sane Defaults
|
||||
{{< /code >}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user