site vcs cleanup

This commit is contained in:
sebastien 2025-10-31 10:25:03 +01:00
parent acfb1733de
commit 86f792d5f3

View File

@ -122,18 +122,12 @@ async function getGitRepoLastCommitInfoMap(
});
}
const isBuild = true; // TODO
function createCustomVcsConfig(): VcsConfig {
if (process.env.DOCUSAURUS_WEBSITE_USE_OLD_VCS_STRATEGY === 'true') {
console.log("Using the old Docusaurus website's VCS strategy");
return DEFAULT_VCS_CONFIG;
}
if (!isBuild) {
return DEFAULT_VCS_CONFIG;
}
let repoInfoPromise: Promise<CommitInfoMap> | null = null;
async function getRepoInfoForFile(
@ -148,16 +142,6 @@ function createCustomVcsConfig(): VcsConfig {
return repoInfo.get(filePath) ?? null;
}
// Try to pre-read the Git repository info as soon as possible
// TODO pre-init here doesn't work because of double config loading
/*
getRepoInfoForFile('.').catch((e) => {
console.error('Failed to read the Docusaurus Git repository info', e);
});
*/
return {
initialize: ({siteDir}) => {
if (process.env.NODE_ENV === 'production') {