mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-20 02:17:39 +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
@@ -8,7 +8,7 @@ _comment: Do not remove front matter.
|
||||
|
||||
The primary use case for `PageInner` is to resolve links and [page resources](g) relative to an included `Page`. For example, create an "include" shortcode to compose a page from multiple content files, while preserving a global context for footnotes and the table of contents:
|
||||
|
||||
{{< code file=layouts/shortcodes/include.html >}}
|
||||
```go-html-template {file="layouts/shortcodes/include.html" copy=true}
|
||||
{{ with .Get 0 }}
|
||||
{{ with $.Page.GetPage . }}
|
||||
{{- .RenderShortcodes }}
|
||||
@@ -18,13 +18,13 @@ The primary use case for `PageInner` is to resolve links and [page resources](g)
|
||||
{{ else }}
|
||||
{{ errorf "The %q shortcode requires a positional parameter indicating the logical path of the file to include. See %s" .Name .Position }}
|
||||
{{ end }}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
Then call the shortcode in your Markdown:
|
||||
|
||||
{{< code file=content/posts/p1.md lang=text >}}
|
||||
```text {file="content/posts/p1.md"}
|
||||
{{%/* include "/posts/p2" */%}}
|
||||
{{< /code >}}
|
||||
```
|
||||
|
||||
Any render hook triggered while rendering `/posts/p2` will get:
|
||||
|
||||
|
||||
Reference in new issue
Block a user