mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 19:46:57 +02:00
refactor(v2): use absolute path instead of alias for metadata source (#967)
refactor(v2): use absolute path instead of alias for metadata source
This commit is contained in:
parent
f2927a9fc4
commit
b401a2adc0
8 changed files with 366 additions and 646 deletions
|
@ -106,16 +106,10 @@ module.exports = async function processMetadata(
|
|||
}
|
||||
|
||||
/*
|
||||
The docs file source
|
||||
e.g: `@docs/hello.md` or `@versioned_docs/version-1.0.0/hello.md`
|
||||
The docs absolute file source
|
||||
e.g: `/end/docs/hello.md` or `/end/website/versioned_docs/version-1.0.0/hello.md`
|
||||
*/
|
||||
if (language && language !== defaultLangTag) {
|
||||
metadata.source = `@translated_docs/${source}`;
|
||||
} else if (version && version !== 'next') {
|
||||
metadata.source = `@versioned_docs/${source}`;
|
||||
} else {
|
||||
metadata.source = `@docs/${source}`;
|
||||
}
|
||||
metadata.source = path.join(refDir, source);
|
||||
|
||||
/* Build the permalink */
|
||||
const {baseUrl, docsUrl} = siteConfig;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue