Skip to content

Commit 2c79093

Browse files
committed
do not throw error on translations, and also do not add redundant data to siteTree item that is already on the page object
1 parent fede31f commit 2c79093

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/create-tree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ module.exports = async function createTree (originalPath, langObj) {
3333
if (!page) {
3434
// Do not throw an error if Early Access is not available.
3535
if (relativePath.startsWith('early-access')) return
36+
// Do not throw an error if this is a translated path, as translations are not always up-to-date.
37+
if (langObj.code !== 'en') return
3638

3739
throw Error(`Cannot initialize page for ${filepath}`)
3840
}
3941

4042
// Create the root tree object on the first run, and create children recursively.
4143
const item = {
42-
relativePath,
43-
title: page.shortTitle || page.title,
4444
page
4545
}
4646

0 commit comments

Comments
 (0)