content: Replace calls to the code shortcode with fenced code blocks

This commit is contained in:
Joe Mooring authored and GitHub committed 2025-03-06 02:49:11 -08:00
1 parent b23c9a583a
commit fd628be6ed
110 files changed
+483 -555

No files matched your search

+8 -8
View File
@@ -11,22 +11,22 @@ params:
When you call a shortcode using positional arguments, the `Params` method returns a slice.
{{< code file=content/about.md lang=text >}}
```text {file="content/about.md"}
{{</* myshortcode "Hello" "world" */>}}
{{< /code >}}
```
{{< code file=layouts/shortcodes/myshortcode.html >}}
```go-html-template {file="layouts/shortcodes/myshortcode.html"}
{{ index .Params 0 }} → Hello
{{ index .Params 1 }} → world
{{< /code >}}
```
When you call a shortcode using named arguments, the `Params` method returns a map.
{{< code file=content/about.md lang=text >}}
```text {file="content/about.md"}
{{</* myshortcode greeting="Hello" name="world" */>}}
{{< /code >}}
```
{{< code file=layouts/shortcodes/myshortcode.html >}}
```go-html-template {file="layouts/shortcodes/myshortcode.html"}
{{ .Params.greeting }} → Hello
{{ .Params.name }} → world
{{< /code >}}
```