No, it is not mandatory to have a table of content on a blog post, but if you are writing a long content, a table of contents certainly provide better user experience to your user. It makes your page user-friendly.