summaryrefslogtreecommitdiffstats
path: root/docs/content/en/methods/shortcode
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/methods/shortcode')
-rw-r--r--docs/content/en/methods/shortcode/Get.md4
-rw-r--r--docs/content/en/methods/shortcode/Inner.md14
-rw-r--r--docs/content/en/methods/shortcode/InnerDeindent.md6
-rw-r--r--docs/content/en/methods/shortcode/IsNamedParams.md2
-rw-r--r--docs/content/en/methods/shortcode/Name.md2
-rw-r--r--docs/content/en/methods/shortcode/Ordinal.md2
-rw-r--r--docs/content/en/methods/shortcode/Page.md2
-rw-r--r--docs/content/en/methods/shortcode/Params.md4
-rw-r--r--docs/content/en/methods/shortcode/Parent.md4
-rw-r--r--docs/content/en/methods/shortcode/Position.md2
10 files changed, 21 insertions, 21 deletions
diff --git a/docs/content/en/methods/shortcode/Get.md b/docs/content/en/methods/shortcode/Get.md
index b9c01cfc4..aef9987f0 100644
--- a/docs/content/en/methods/shortcode/Get.md
+++ b/docs/content/en/methods/shortcode/Get.md
@@ -24,7 +24,7 @@ This shortcode call uses positional arguments:
To retrieve arguments by position:
-```go-html-template {file="layouts/shortcodes/myshortcode.html"}
+```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ printf "%s %s." (.Get 0) (.Get 1) }} → Hello world.
```
@@ -38,7 +38,7 @@ This shortcode call uses named arguments:
To retrieve arguments by name:
-```go-html-template {file="layouts/shortcodes/myshortcode.html"}
+```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ printf "%s %s." (.Get "greeting") (.Get "firstName") }} → Hello world.
```
diff --git a/docs/content/en/methods/shortcode/Inner.md b/docs/content/en/methods/shortcode/Inner.md
index cdce4c1c3..bb5a16a01 100644
--- a/docs/content/en/methods/shortcode/Inner.md
+++ b/docs/content/en/methods/shortcode/Inner.md
@@ -19,7 +19,7 @@ We design the **best** widgets in the world.
With this shortcode:
-```go-html-template {file="layouts/shortcodes/card.html"}
+```go-html-template {file="layouts/_shortcodes/card.html"}
<div class="card">
{{ with .Get "title" }}
<div class="card-title">{{ . }}</div>
@@ -51,7 +51,7 @@ Is rendered to:
Let's modify the example above to pass the value returned by `Inner` through the [`RenderString`] method on the `Page` object:
-```go-html-template {file="layouts/shortcodes/card.html"}
+```go-html-template {file="layouts/_shortcodes/card.html"}
<div class="card">
{{ with .Get "title" }}
<div class="card-title">{{ . }}</div>
@@ -98,7 +98,7 @@ This configuration is not unsafe if _you_ control the content. Read more about H
Second, because we are rendering the entire shortcode as Markdown, we must adhere to the rules governing [indentation] and inclusion of [raw HTML blocks] as provided in the [CommonMark] specification.
-```go-html-template {file="layouts/shortcodes/card.html"}
+```go-html-template {file="layouts/_shortcodes/card.html"}
<div class="card">
{{ with .Get "title" }}
<div class="card-title">{{ . }}</div>
@@ -113,8 +113,8 @@ Second, because we are rendering the entire shortcode as Markdown, we must adher
The difference between this and the previous example is subtle but required. Note the change in indentation, the addition of a blank line, and removal of the `RenderString` method.
```diff
---- layouts/shortcodes/a.html
-+++ layouts/shortcodes/b.html
+--- layouts/_shortcodes/a.html
++++ layouts/_shortcodes/b.html
@@ -1,8 +1,9 @@
<div class="card">
{{ with .Get "title" }}
@@ -137,7 +137,7 @@ The difference between this and the previous example is subtle but required. Not
[`strings.TrimSpace`]: /functions/strings/trimspace/
[CommonMark]: https://spec.commonmark.org/current/
[details]: /methods/page/renderstring/
-[indentation]: https://spec.commonmark.org/0.30/#indented-code-blocks
+[indentation]: https://spec.commonmark.org/current/#indented-code-blocks
[Markdown notation]: /content-management/shortcodes/#notation
-[raw HTML blocks]: https://spec.commonmark.org/0.31.2/#html-blocks
+[raw HTML blocks]: https://spec.commonmark.org/current/#html-blocks
[security model]: /about/security/
diff --git a/docs/content/en/methods/shortcode/InnerDeindent.md b/docs/content/en/methods/shortcode/InnerDeindent.md
index 0b8c8e2d8..3d7536b6b 100644
--- a/docs/content/en/methods/shortcode/InnerDeindent.md
+++ b/docs/content/en/methods/shortcode/InnerDeindent.md
@@ -35,7 +35,7 @@ In the example above, notice that the content between the opening and closing sh
With this shortcode, calling `Inner` instead of `InnerDeindent`:
-```go-html-template {file="layouts/shortcodes/gallery.html"}
+```go-html-template {file="layouts/_shortcodes/gallery.html"}
<div class="gallery">
{{ .Inner | strings.TrimSpace | .Page.RenderString }}
</div>
@@ -66,7 +66,7 @@ Hugo renders the Markdown to:
Although technically correct per the CommonMark specification, this is not what we want. If we remove the indentation using the `InnerDeindent` method:
-```go-html-template {file="layouts/shortcodes/gallery.html"}
+```go-html-template {file="layouts/_shortcodes/gallery.html"}
<div class="gallery">
{{ .InnerDeindent | strings.TrimSpace | .Page.RenderString }}
</div>
@@ -94,5 +94,5 @@ Hugo renders the Markdown to:
```
[commonmark]: https://commonmark.org/
-[indentation]: https://spec.commonmark.org/0.30/#indented-code-blocks
+[indentation]: https://spec.commonmark.org/current/#indented-code-blocks
[`Inner`]: /methods/shortcode/inner/
diff --git a/docs/content/en/methods/shortcode/IsNamedParams.md b/docs/content/en/methods/shortcode/IsNamedParams.md
index 1e0a7f00e..c95398313 100644
--- a/docs/content/en/methods/shortcode/IsNamedParams.md
+++ b/docs/content/en/methods/shortcode/IsNamedParams.md
@@ -13,7 +13,7 @@ To support both positional and named arguments when calling a shortcode, use the
With this shortcode template:
-```go-html-template {file="layouts/shortcodes/myshortcode.html"}
+```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ if .IsNamedParams }}
{{ printf "%s %s." (.Get "greeting") (.Get "firstName") }}
{{ else }}
diff --git a/docs/content/en/methods/shortcode/Name.md b/docs/content/en/methods/shortcode/Name.md
index b5f9b6c17..c42513cb2 100644
--- a/docs/content/en/methods/shortcode/Name.md
+++ b/docs/content/en/methods/shortcode/Name.md
@@ -11,7 +11,7 @@ params:
The `Name` method is useful for error reporting. For example, if your shortcode requires a "greeting" argument:
-```go-html-template {file="layouts/shortcodes/myshortcode.html"}
+```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ $greeting := "" }}
{{ with .Get "greeting" }}
{{ $greeting = . }}
diff --git a/docs/content/en/methods/shortcode/Ordinal.md b/docs/content/en/methods/shortcode/Ordinal.md
index def0c016f..4c32705c1 100644
--- a/docs/content/en/methods/shortcode/Ordinal.md
+++ b/docs/content/en/methods/shortcode/Ordinal.md
@@ -24,7 +24,7 @@ This method is useful for, among other things, assigning unique element IDs when
This shortcode performs error checking, then renders an HTML `img` element with a unique `id` attribute:
-```go-html-template {file="layouts/shortcodes/img.html"}
+```go-html-template {file="layouts/_shortcodes/img.html"}
{{ $src := "" }}
{{ with .Get "src" }}
{{ $src = . }}
diff --git a/docs/content/en/methods/shortcode/Page.md b/docs/content/en/methods/shortcode/Page.md
index 774caf9fc..0fa1c9cc9 100644
--- a/docs/content/en/methods/shortcode/Page.md
+++ b/docs/content/en/methods/shortcode/Page.md
@@ -26,7 +26,7 @@ Calling this shortcode:
We can access the front matter values using the `Page` method:
-```go-html-template {file="layouts/shortcodes/book-details.html"}
+```go-html-template {file="layouts/_shortcodes/book-details.html"}
<ul>
<li>Title: {{ .Page.Title }}</li>
<li>Author: {{ .Page.Params.author }}</li>
diff --git a/docs/content/en/methods/shortcode/Params.md b/docs/content/en/methods/shortcode/Params.md
index f001e737f..c8252f5b1 100644
--- a/docs/content/en/methods/shortcode/Params.md
+++ b/docs/content/en/methods/shortcode/Params.md
@@ -15,7 +15,7 @@ When you call a shortcode using positional arguments, the `Params` method return
{{</* myshortcode "Hello" "world" */>}}
```
-```go-html-template {file="layouts/shortcodes/myshortcode.html"}
+```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ index .Params 0 }} → Hello
{{ index .Params 1 }} → world
```
@@ -26,7 +26,7 @@ When you call a shortcode using named arguments, the `Params` method returns a m
{{</* myshortcode greeting="Hello" name="world" */>}}
```
-```go-html-template {file="layouts/shortcodes/myshortcode.html"}
+```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ .Params.greeting }} → Hello
{{ .Params.name }} → world
```
diff --git a/docs/content/en/methods/shortcode/Parent.md b/docs/content/en/methods/shortcode/Parent.md
index 91c445d2a..4597d1034 100644
--- a/docs/content/en/methods/shortcode/Parent.md
+++ b/docs/content/en/methods/shortcode/Parent.md
@@ -19,13 +19,13 @@ Welcome. Today is {{</* now */>}}.
{{</* /greeting */>}}
```
-```go-html-template {file="layouts/shortcodes/greeting.html"}
+```go-html-template {file="layouts/_shortcodes/greeting.html"}
<div class="greeting">
{{ .Inner | strings.TrimSpace | .Page.RenderString }}
</div>
```
-```go-html-template {file="layouts/shortcodes/now.html"}
+```go-html-template {file="layouts/_shortcodes/now.html"}
{{- $dateFormat := "January 2, 2006 15:04:05" }}
{{- with .Params }}
diff --git a/docs/content/en/methods/shortcode/Position.md b/docs/content/en/methods/shortcode/Position.md
index 24810e825..4052a735b 100644
--- a/docs/content/en/methods/shortcode/Position.md
+++ b/docs/content/en/methods/shortcode/Position.md
@@ -11,7 +11,7 @@ params:
The `Position` method is useful for error reporting. For example, if your shortcode requires a "greeting" argument:
-```go-html-template {file="layouts/shortcodes/myshortcode.html"}
+```go-html-template {file="layouts/_shortcodes/myshortcode.html"}
{{ $greeting := "" }}
{{ with .Get "greeting" }}
{{ $greeting = . }}