mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-09 06:12:28 +02:00
fix: markdown linking for translated & versioned docs
This commit is contained in:
parent
e9f2fabde1
commit
c0194a1f53
11 changed files with 306 additions and 19 deletions
|
@ -27,10 +27,16 @@ module.exports = async function load(siteDir) {
|
|||
);
|
||||
|
||||
/* Create source to permalink mapping */
|
||||
const sourceToLink = {};
|
||||
Object.values(docsMetadata).forEach(({source, permalink}) => {
|
||||
sourceToLink[source] = permalink;
|
||||
});
|
||||
const sourceToMetadata = {};
|
||||
Object.values(docsMetadata).forEach(
|
||||
({source, version, permalink, language}) => {
|
||||
sourceToMetadata[source] = {
|
||||
version,
|
||||
permalink,
|
||||
language
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
// pages
|
||||
const pagesDir = path.resolve(siteDir, 'pages');
|
||||
|
@ -61,7 +67,7 @@ module.exports = async function load(siteDir) {
|
|||
outDir,
|
||||
themePath,
|
||||
baseUrl,
|
||||
sourceToLink,
|
||||
sourceToMetadata,
|
||||
versionedDir,
|
||||
translatedDir
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue