mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-16 08:15:10 +00:00
content: Replace calls to the code shortcode with fenced code blocks
This commit is contained in:
1 parent
b23c9a583a
commit
fd628be6ed
110 files changed
+483
-555
No files matched your search
@@ -13,17 +13,17 @@ To support both positional and named arguments when calling a shortcode, use the
|
||||
|
||||
With this shortcode template:
|
||||
|
||||
{{< code file=layouts/shortcodes/myshortcode.html >}}
|
||||
```go-html-template {file="layouts/shortcodes/myshortcode.html"}
|
||||
{{ if .IsNamedParams }}
|
||||
{{ printf "%s %s." (.Get "greeting") (.Get "firstName") }}
|
||||
{{ else }}
|
||||
{{ printf "%s %s." (.Get 0) (.Get 1) }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
Both of these calls return the same value:
|
||||
|
||||
{{< code file=content/about.md lang=text >}}
|
||||
```text {file="content/about.md"}
|
||||
{{</* myshortcode greeting="Hello" firstName="world" */>}}
|
||||
{{</* myshortcode "Hello" "world" */>}}
|
||||
{{< /code >}}
|
||||
```
|
||||
Reference in new issue
Block a user