mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
shortcodes: don't break build and render for invalid parameters #480
This commit is contained in:
parent
472176a88c
commit
0e0b3bb2fb
5 changed files with 66 additions and 3 deletions
43
exampleSite/content/tests/frontmatter.en.md
Normal file
43
exampleSite/content/tests/frontmatter.en.md
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
+++
|
||||||
|
description = "Test default settings for snippets of the VSCode Front Matter extension"
|
||||||
|
title = "VSCode Front Matter"
|
||||||
|
+++
|
||||||
|
|
||||||
|
## Empty Properties
|
||||||
|
|
||||||
|
{{< attachments title="" pattern="" sort="" style="" color="" icon="" />}}
|
||||||
|
|
||||||
|
{{< badge title="" style="" color="" icon="" >}}{{< /badge >}}
|
||||||
|
|
||||||
|
{{< button href="" target="" type="" style="" color="" icon="" iconposition="" >}}{{< /button >}}
|
||||||
|
|
||||||
|
{{< children description="" depth="" sort="" showhidden="" containerstyle="" style="" >}}
|
||||||
|
|
||||||
|
{{% expand title="" open="" %}}{{% /expand %}}
|
||||||
|
|
||||||
|
a{{< icon >}}a
|
||||||
|
|
||||||
|
{{< include file="" hidefirstheading="" >}}
|
||||||
|
|
||||||
|
````math align=""
|
||||||
|
|
||||||
|
````
|
||||||
|
|
||||||
|
````mermaid align="" zoom=""
|
||||||
|
|
||||||
|
````
|
||||||
|
|
||||||
|
{{% notice title="" style="" color="" icon="" %}}{{% /notice %}}
|
||||||
|
|
||||||
|
{{< siteparam >}}
|
||||||
|
|
||||||
|
{{< swagger src="" >}}
|
||||||
|
|
||||||
|
{{< tabs groupid="" >}}
|
||||||
|
{{% tab name="" %}}
|
||||||
|
|
||||||
|
{{% /tab %}}
|
||||||
|
{{% tab name="" %}}
|
||||||
|
|
||||||
|
{{% /tab %}}
|
||||||
|
{{< /tabs >}}
|
5
exampleSite/content/tests/frontmatter.pir.md
Normal file
5
exampleSite/content/tests/frontmatter.pir.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
+++
|
||||||
|
description = "Test default settings for snippets of the VSCode Front Matter extension"
|
||||||
|
title = "VSCode Front Matter"
|
||||||
|
+++
|
||||||
|
{{< piratify >}}
|
|
@ -4,10 +4,12 @@
|
||||||
{{- if eq (printf "%T" $hideFirstHeading) "string" }}
|
{{- if eq (printf "%T" $hideFirstHeading) "string" }}
|
||||||
{{- $hideFirstHeading = (eq $hideFirstHeading "true") }}
|
{{- $hideFirstHeading = (eq $hideFirstHeading "true") }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $hideFirstHeading }}<div class="include hide-first-heading">{{ end }}
|
{{- if and (gt (len (trim $file " ")) 0) (fileExists $file) }}
|
||||||
{{- with $context }}
|
{{- if $hideFirstHeading }}<div class="include hide-first-heading">{{ end }}
|
||||||
|
{{- with $context }}
|
||||||
|
|
||||||
{{ $file | readFile | safeHTML }}
|
{{ $file | readFile | safeHTML }}
|
||||||
|
|
||||||
{{- if $hideFirstHeading }}</div>{{ end }}
|
{{- end }}
|
||||||
|
{{- if $hideFirstHeading }}</div>{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -24,6 +24,10 @@ html[dir="rtl"] #body .tab-nav-button{
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#body .tab-nav-button:after {
|
||||||
|
content: "\200b"
|
||||||
|
}
|
||||||
|
|
||||||
#body .tab-nav-button:first-child{
|
#body .tab-nav-button:first-child{
|
||||||
margin-inline-start: 9px;
|
margin-inline-start: 9px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1318,6 +1318,11 @@ html[dir="rtl"] .expand > .expand-label > i.fa-chevron-right {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn > *:after {
|
||||||
|
/* avoid breakage if no content is given */
|
||||||
|
content: "\200b"
|
||||||
|
}
|
||||||
|
|
||||||
#body #body-inner .btn > *.highlight:after {
|
#body #body-inner .btn > *.highlight:after {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
@ -1700,6 +1705,10 @@ html[dir] #sidebar .collapsible-menu input.toggle:checked:before {
|
||||||
border-end-start-radius: 0;
|
border-end-start-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.badge-content:after {
|
||||||
|
/* avoid breakage if no content is given */
|
||||||
|
content: "\200b";
|
||||||
|
}
|
||||||
/* task list and its checkboxes */
|
/* task list and its checkboxes */
|
||||||
article ul li:has(input[type="checkbox"]) {
|
article ul li:has(input[type="checkbox"]) {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
|
Loading…
Reference in a new issue