Update wrapper shortcode to accommodate changes made in Hugo 0.55 to how the % delimiter works in shortcodes.
This commit is contained in:
parent
ea4f1a5d33
commit
5342b34f1b
2 changed files with 27 additions and 5 deletions
30
README.md
30
README.md
|
|
@ -216,19 +216,41 @@ blablabla # Displayed below of the image.
|
||||||
|
|
||||||
### Wrapper
|
### Wrapper
|
||||||
|
|
||||||
A simple, but useful, shortcode to wrap content in a div with a class.
|
A simple, but useful, shortcode to wrap content in a div with a class. The content will be run through "markdownify".
|
||||||
|
|
||||||
```
|
```
|
||||||
{{% wrapper class-name-you-want %}}
|
{{< wrapper class-name-you-want markdown >}}
|
||||||
The **content** that should be wrapped.
|
The **content** that should be wrapped.
|
||||||
{{% /wrapper %}}
|
|
||||||
|
Some more content.
|
||||||
|
{{< /wrapper >}}
|
||||||
```
|
```
|
||||||
|
|
||||||
This will produce:
|
This will produce:
|
||||||
|
|
||||||
```
|
```
|
||||||
<div class="class-name-you-want">
|
<div class="class-name-you-want">
|
||||||
The <strong>content</strong> that should be wrapped.
|
<p>The <strong>content</strong> that should be wrapped.</p>
|
||||||
|
|
||||||
|
<p>Some more content.</p>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
If the content should be left untouched add "nomarkdown" after the class name.
|
||||||
|
|
||||||
|
```
|
||||||
|
{{< wrapper class-name-you-want nomarkdown >}}
|
||||||
|
The **content** that should be wrapped.
|
||||||
|
|
||||||
|
Some more content.
|
||||||
|
{{< /wrapper >}}
|
||||||
|
```
|
||||||
|
|
||||||
|
This will produce:
|
||||||
|
|
||||||
|
```
|
||||||
|
<div class="class-name-you-want">
|
||||||
|
The **content** that should be wrapped. Some more content.
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
<div class="{{ .Get 0 }}">{{ .Inner }}</div>
|
<div class="{{ .Get 0 }}">{{ if eq (.Get 1) "nomarkdown" }}{{ .Inner }}{{ else }}{{ .Inner | markdownify }}{{ end }}</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue