Yes, it does.
No, it is not.
Yes, it does.
Render the TOC if it contains a list item element:
{{ if in .TableOfContents "li" }}
{{ .TableOfContents }}
{{ end }}
or
{{ if strings.Contains .TableOfContents "li" }}
{{ .TableOfContents }}
{{ end }}
https://gohugo.io/functions/collections/in/
https://gohugo.io/functions/strings/contains/