build(aio): fix paths to "index" pages

Content pages like `tutorial/index.md` were being mapped to `tutorial.index.json`,
which meant that they could only be rendered if you browsed to `/tutorial/index`.

This didn't sit well so now these pages are mapped to `tutorial.json`, which
means that you browser to them via `/tutorial/` or just `/tutorial`.

Fixed #15335
This commit is contained in:
Peter Bacon Darwin
2017-03-21 07:02:58 +00:00
committed by Miško Hevery
parent c9710d4fb5
commit fc1f6efe0d
5 changed files with 43 additions and 8 deletions

View File

@ -266,7 +266,11 @@ module.exports =
outputPathTemplate: '${moduleDoc.moduleFolder}/${name}.json',
},
{docTypes: ['example-region'], getOutputPath: function() {}},
{docTypes: ['content'], pathTemplate: '${id}', outputPathTemplate: '${path}.json'},
{
docTypes: ['content'],
getPath: (doc) => `${doc.id.replace(/\/index$/, '')}`,
outputPathTemplate: '${path}.json'
},
{docTypes: ['navigation-map'], pathTemplate: '${id}', outputPathTemplate: '../${id}.json'}
];
})