mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 06:17:45 +00:00
1 parent
ad4a124c0c
commit
b8d5383f71
175 files changed
+382
-378
No files matched your search
@@ -48,7 +48,7 @@ Is rendered to:
|
||||
{{% note %}}
|
||||
Content between opening and closing shortcode tags may include leading and/or trailing newlines, depending on placement within the markdown. Use the [`trim`] function as shown above to remove both carriage returns and newlines.
|
||||
|
||||
[`trim`]: /functions/strings/trim
|
||||
[`trim`]: /functions/strings/trim/
|
||||
{{% /note %}}
|
||||
|
||||
{{% note %}}
|
||||
@@ -60,7 +60,7 @@ In the example above, the value returned by `Inner` is markdown, but it was rend
|
||||
|
||||
Let's modify the example above to pass the value returned by `Inner` through the [`RenderString`] method on the `Page` object:
|
||||
|
||||
[`RenderString`]: /methods/page/renderstring
|
||||
[`RenderString`]: /methods/page/renderstring/
|
||||
|
||||
{{< code file=layouts/shortcodes/card.html >}}
|
||||
<div class="card">
|
||||
@@ -86,8 +86,8 @@ Hugo renders this to:
|
||||
|
||||
You can use the [`markdownify`] function instead of the `RenderString` method, but the latter is more flexible. See [details].
|
||||
|
||||
[details]: /methods/page/renderstring
|
||||
[`markdownify`]: /functions/transform/markdownify
|
||||
[details]: /methods/page/renderstring/
|
||||
[`markdownify`]: /functions/transform/markdownify/
|
||||
|
||||
## Use alternate notation
|
||||
|
||||
|
||||
@@ -96,4 +96,4 @@ Hugo renders the markdown to:
|
||||
|
||||
[commonmark]: https://commonmark.org/
|
||||
[indentation]: https://spec.commonmark.org/0.30/#indented-code-blocks
|
||||
[`Inner`]: /methods/shortcode/inner
|
||||
[`Inner`]: /methods/shortcode/inner/
|
||||
@@ -46,5 +46,5 @@ Hugo renders the page to:
|
||||
{{% note %}}
|
||||
In the shortcode template above, the [`with`] statement is used to create conditional blocks. Remember that the `with` statement binds context (the dot) to its expression. Inside of a `with` block, preface shortcode method calls with a `$` to access the top level context passed into the template.
|
||||
|
||||
[`with`]: /functions/go-template/with
|
||||
[`with`]: /functions/go-template/with/
|
||||
{{% /note %}}
|
||||
@@ -16,7 +16,7 @@ The `Scratch` method within a shortcode creates a [scratch pad] to store and man
|
||||
With the introduction of the [`newScratch`] function, and the ability to [assign values to template variables] after initialization, the `Scratch` method within a shortcode is obsolete.
|
||||
|
||||
[assign values to template variables]: https://go.dev/doc/go1.11#text/template
|
||||
[`newScratch`]: functions/collections/newscratch
|
||||
[`newScratch`]: /functions/collections/newscratch/
|
||||
{{% /note %}}
|
||||
|
||||
[scratch pad]: /getting-started/glossary/#scratch-pad
|
||||
|
||||
@@ -12,7 +12,7 @@ action:
|
||||
|
||||
See [Site methods].
|
||||
|
||||
[Site methods]: /methods/site
|
||||
[Site methods]: /methods/site/
|
||||
|
||||
```go-html-template
|
||||
{{ .Site.Title }}
|
||||
|
||||
Reference in new issue
Block a user