fixed toctree in docs, added check to pager template

I forgot to add a link to the extensions.rst from the index.rst in the last pr so added it now.

The added check in pager template is pretty trivial tbh. No need to show both buttons when they point to the same page.