mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
misc(v2): clean up comments in code (#2294)
This commit is contained in:
parent
d7f3dff6e6
commit
996b115199
45 changed files with 234 additions and 155 deletions
|
@ -32,7 +32,7 @@ async function lastUpdated(
|
|||
): Promise<LastUpdateData> {
|
||||
const {showLastUpdateAuthor, showLastUpdateTime} = options;
|
||||
if (showLastUpdateAuthor || showLastUpdateTime) {
|
||||
// Use fake data in dev for faster development
|
||||
// Use fake data in dev for faster development.
|
||||
const fileLastUpdateData =
|
||||
process.env.NODE_ENV === 'production'
|
||||
? await lastUpdate(filePath)
|
||||
|
@ -49,6 +49,7 @@ async function lastUpdated(
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
@ -83,7 +84,7 @@ export default async function processMetadata({
|
|||
}
|
||||
}
|
||||
|
||||
// The version portion of the url path. Eg: 'next', '1.0.0', and ''
|
||||
// The version portion of the url path. Eg: 'next', '1.0.0', and ''.
|
||||
const versionPath =
|
||||
version && version !== versioning.latestVersion ? version : '';
|
||||
|
||||
|
@ -112,7 +113,7 @@ export default async function processMetadata({
|
|||
|
||||
const description: string = frontMatter.description || excerpt;
|
||||
|
||||
// The last portion of the url path. Eg: 'foo/bar', 'bar'
|
||||
// The last portion of the url path. Eg: 'foo/bar', 'bar'.
|
||||
const routePath =
|
||||
version && version !== 'next'
|
||||
? id.replace(new RegExp(`^version-${version}/`), '')
|
||||
|
@ -126,8 +127,10 @@ export default async function processMetadata({
|
|||
|
||||
const {lastUpdatedAt, lastUpdatedBy} = await lastUpdatedPromise;
|
||||
|
||||
// Assign all of object properties during instantiation (if possible) for NodeJS optimization
|
||||
// Adding properties to object after instantiation will cause hidden class transitions.
|
||||
// Assign all of object properties during instantiation (if possible) for
|
||||
// NodeJS optimization.
|
||||
// Adding properties to object after instantiation will cause hidden
|
||||
// class transitions.
|
||||
const metadata: MetadataRaw = {
|
||||
id,
|
||||
title,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue