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:
Endilie Y 2018-09-18 12:29:14 +08:00 committed by GitHub
parent f2927a9fc4
commit b401a2adc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 366 additions and 646 deletions

View file

@ -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;