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

+6 -6
View File
@@ -14,19 +14,19 @@ This is useful for inheritance of common shortcode arguments from the root.
In this contrived example, the "greeting" shortcode is the parent, and the "now" shortcode is child.
{{< code file=content/welcome.md lang=text >}}
```text {file="content/welcome.md"}
{{</* greeting dateFormat="Jan 2, 2006" */>}}
Welcome. Today is {{</* now */>}}.
{{</* /greeting */>}}
{{< /code >}}
```
{{< code file=layouts/shortcodes/greeting.html >}}
```go-html-template {file="layouts/shortcodes/greeting.html"}
<div class="greeting">
{{ .Inner | strings.TrimSpace | .Page.RenderString }}
</div>
{{< /code >}}
```
{{< code file=layouts/shortcodes/now.html >}}
```go-html-template {file="layouts/shortcodes/now.html"}
{{- $dateFormat := "January 2, 2006 15:04:05" }}
{{- with .Params }}
@@ -42,7 +42,7 @@ Welcome. Today is {{</* now */>}}.
{{- end }}
{{- now | time.Format $dateFormat -}}
{{< /code >}}
```
The "now" shortcode formats the current time using: