mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
Add previous and next titles to metadata props
This commit is contained in:
parent
429ffda351
commit
7b2e950a4c
2 changed files with 14 additions and 3 deletions
|
@ -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" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue