fix bug in docsite check template with zero headings
Created by: sqs
If a doc/ Markdown document has zero headings (i.e., no # Foo
or #### Foo
headings), docsite check
would fail with an inscrutable error like:
dev/release_issue_template.md: template: root:22:41: executing "index" at <index .Doc.Tree 0>: error calling index: index out of range: 0
dev/releases.md: broken link to /dev/release_issue_template
dev/releases.md: broken link to /dev/release_issue_template
This occurs because the Go template expression tries to index into the 0th element. Go's template expressions don't short-circuit, so this index attempt occurs even if the length check fails.
We don't need this precise behavior because this template is only used for checking, not for actual rendering.