Add previous and next titles to metadata props

This commit is contained in:
Joel Marcey 2017-10-24 19:09:34 -07:00
parent 429ffda351
commit 7b2e950a4c
2 changed files with 14 additions and 3 deletions

View file

@ -289,6 +289,17 @@ function generateMetadataDocs() {
metadatas[metadata.id] = metadata;
});
// Get the titles of the previous and next ids so that we can use them in
// navigation buttons in DocsLayout.js
Object.keys(metadatas).forEach(function(metadata) {
if (metadatas[metadata].previous) {
metadatas[metadata].previous_title = metadatas[metadatas[metadata].previous].title;
}
if (metadatas[metadata].next) {
metadatas[metadata].next_title = metadatas[metadatas[metadata].next].title;
}
});
fs.writeFileSync(
__dirname + "/../core/metadata.js",
"/**\n" +