You have an ambiguous configuration and the behaviour is undefined. There is an open issue to create warnings in this case, but I haven’t gotten to it yet.
But to make a long story short, you would be better off renaming “index.md” to “_index.md”. See the documentation for more info.
@bep Thank you, this seems to work. But when I rename the page, I have another problem: how do I link to the _index.md page?
Using {{< ref "_index.md" >}} gives me an error:
$ hugo server
Started building sites ...
ERROR 2017/11/24 12:27:09 error processing shortcode "_internal/shortcodes/ref.html" for page "_index.md": template: _internal/shortcodes/ref.html:1:73: executing "_internal/shortcodes/ref.html" at <ref .Page (.Get 0)>: error calling ref: No page found with path or logical name "_index.md".
ERROR 2017/11/24 12:27:09 error processing shortcode "_internal/shortcodes/ref" for page "_index.md": template: _internal/shortcodes/ref.html:1:73: executing "_internal/shortcodes/ref" at <ref .Page (.Get 0)>: error calling ref: No page found with path or logical name "_index.md".
I have found lot’s of pages here in the forum having problems with _index.md, but none of these helped me yet. So if anybody has any keywords, I’d be very happy.