https://www.dokuwiki.org/plugin:headerfooter but note that it has been unmaintained for a couple of years. The index can be generated from
https://www.dokuwiki.org/plugin:indexmenu
I haven't tried this (so you're on your own) but after installation try:
$ cat __header.txt
{{indexmenu>.|nsort}}
$
I use the indexmenu function as a lazy way to generate a clickable list of pages in a na,mespace that is rapidly changing.