Skip to content

Commit 0b8f4be

Browse files
committed
website: re-generate commons
1 parent 821fe1c commit 0b8f4be

2 files changed

Lines changed: 2520 additions & 1948 deletions

File tree

website/customFields.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,30 @@ export function getCustomFields() {
7373

7474
let websiteFields = {};
7575
try {
76-
const websiteFilePath = path.join(path.dirname(path.dirname(pwd)), 'website', 'package.json');
76+
const websiteFilePath = path.join(
77+
path.dirname(path.dirname(pwd)),
78+
"website",
79+
"config",
80+
"website-templates.json",
81+
);
7782
// console.log(filePath);
7883
const websiteFileContent = fs.readFileSync(websiteFilePath);
7984
const websitePackageJson = JSON.parse(websiteFileContent.toString());
80-
websiteFields = websitePackageJson?.websiteConfig ?? {};
85+
websiteFields = websitePackageJson ?? {};
8186
} catch (error) {
82-
// Most probably there is no website/package.json.
87+
try {
88+
const websiteFilePath = path.join(
89+
path.dirname(path.dirname(pwd)),
90+
"website",
91+
"package.json",
92+
);
93+
// console.log(filePath);
94+
const websiteFileContent = fs.readFileSync(websiteFilePath);
95+
const websitePackageJson = JSON.parse(websiteFileContent.toString());
96+
websiteFields = websitePackageJson?.websiteConfig ?? {};
97+
} catch (error) {
98+
// Most probably there is no website/package.json.
99+
}
83100
}
84101

85102
return {

0 commit comments

Comments
 (0)