The YAML setting `toc: true` works for PDF creation but for HTML it
simply prints `true` as the table of contents.
It looks like a misconception and the only acceptable solution I have
found is to use `--toc` on the command line instead of the `toc: true`
setting in the YAML header.
It is a known issue, here are more details:
https://github.com/jgm/pandoc/issues/2872
With this fix I get table of contents not only for PDF but for HTML too.
The PDF looks like before for me, the table of contents and the outline
are still present as it was before.