{{ if ne .TableOfContents "<nav id=\"TableOfContents\"></nav>" }} <p class="toc-title">Table of contents:</p> {{ .TableOfContents }} {{ end }}