我需要检查短代码中的变量“text”,如果存在则
{{ .Inner | markdownify}}
重要的是,变量只是存在并且没有值,如果有“文本”,则不需要关闭冲击代码
{{<toc text>}}
我尝试了这个解决方案,但它给出了错误:无法提取短代码:短代码“toc”必须关闭或自关闭
{{ if isset .Params `text` }}
<div class="col">
{{ .Inner | markdownify }}
</div>
{{ end }}
我想应该是:
{{ if isset .Params.text }}
<div class="col">
{{ .Inner | markdownify }}
</div>
{{ end }}