Trying to only show items that currently have a value, I’ve noticed my .md files are saving some items with no values with a line break and “” in some instances. I do not want to show empty items, or items with a “”.
- template: people
list:
- template: regions
list:
- ""
I’ve tried the following code which works for not displaying items without any content, but still shows items with “”.
{{ if ( .list ) and ( .list "!=" "") }}
{{ range .list }}
<p> {{ . }}</p>
{{ end }}
{{ else }}
<p> no items found </p>
{{ end }}
{{ end }}
I originally was hoping to do this, but the .md files are generated from an app, and there is a high volume of files being generated, so manually going in to delete the “” would not be an option.