mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-09-10 04:19:50 +00:00
Remove superfluous shortcode param
This commit is contained in:
@@ -15,7 +15,7 @@ action:
|
||||
|
||||
This content:
|
||||
|
||||
{{< code file="content/services.md" lang=md copy=false >}}
|
||||
{{< code file="content/services.md" lang=md >}}
|
||||
{{</* card title="Product Design" */>}}
|
||||
We design the **best** widgets in the world.
|
||||
{{</* /card */>}}
|
||||
@@ -23,7 +23,7 @@ We design the **best** widgets in the world.
|
||||
|
||||
With this shortcode:
|
||||
|
||||
{{< code file="layouts/shortcodes/card.html" lang=go-html-template copy=false >}}
|
||||
{{< code file="layouts/shortcodes/card.html" lang=go-html-template >}}
|
||||
<div class="card">
|
||||
{{ with .Get "title" }}
|
||||
<div class="card-title">{{ . }}</div>
|
||||
@@ -62,7 +62,7 @@ Let's modify the example above to pass the value returned by `Inner` through the
|
||||
|
||||
[`RenderString`]: /methods/page/renderstring
|
||||
|
||||
{{< code file="layouts/shortcodes/card.html" lang=go-html-template copy=false >}}
|
||||
{{< code file="layouts/shortcodes/card.html" lang=go-html-template >}}
|
||||
<div class="card">
|
||||
{{ with .Get "title" }}
|
||||
<div class="card-title">{{ . }}</div>
|
||||
@@ -93,7 +93,7 @@ You can use the [`markdownify`] function instead of the `RenderString` method, b
|
||||
|
||||
Instead of calling the shortcode with the `{{</* */>}}` notation, use the `{{%/* */%}}` notation:
|
||||
|
||||
{{< code file="content/services.md" lang=md copy=false >}}
|
||||
{{< code file="content/services.md" lang=md >}}
|
||||
{{%/* card title="Product Design" */%}}
|
||||
We design the **best** widgets in the world.
|
||||
{{%/* /card */%}}
|
||||
@@ -103,7 +103,7 @@ When you use the `{{%/* */%}}` notation, Hugo renders the entire shortcode as ma
|
||||
|
||||
First, configure the renderer to allow raw HTML within markdown:
|
||||
|
||||
{{< code-toggle file=hugo copy=false >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true
|
||||
{{< /code-toggle >}}
|
||||
@@ -112,7 +112,7 @@ This configuration is not unsafe if _you_ control the content. Read more about H
|
||||
|
||||
Second, because we are rendering the entire shortcode as markdown, we must adhere to the rules governing [indentation] and inclusion of [raw HTML blocks] as provided in the [CommonMark] specification.
|
||||
|
||||
{{< code file="layouts/shortcodes/card.html" lang=go-html-template copy=false >}}
|
||||
{{< code file="layouts/shortcodes/card.html" lang=go-html-template >}}
|
||||
<div class="card">
|
||||
{{ with .Get "title" }}
|
||||
<div class="card-title">{{ . }}</div>
|
||||
|
||||
Reference in New Issue
Block a user