diff --git a/docs/getting-started/introduction.mdx b/docs/getting-started/introduction.mdx index b6cb0b7f..c975614f 100644 --- a/docs/getting-started/introduction.mdx +++ b/docs/getting-started/introduction.mdx @@ -97,7 +97,7 @@ $ ( export OUTPUT=export export HOME_REDIRECT= export MDX_BASEURL=http://localhost:$_PORT - export SOURCECODE_BASEURL="vscode://file$(pwd)/docs" + export SOURCECODE_BASEURL="vscode://file$(pwd)" export EDIT_BASEURL="vscode://file$(pwd)/docs" export NEXT_PUBLIC_URL= export ICON= diff --git a/src/utils/docs.tsx b/src/utils/docs.tsx index a9b20ff8..88d9bfe2 100644 --- a/src/utils/docs.tsx +++ b/src/utils/docs.tsx @@ -93,10 +93,6 @@ async function _getDocs( // editURL const EDIT_BASEURL = process.env.EDIT_BASEURL const editURL = EDIT_BASEURL?.length ? file.replace(root, EDIT_BASEURL) : undefined - const SOURCECODE_BASEURL = process.env.SOURCECODE_BASEURL - const sourcecodeURL = SOURCECODE_BASEURL?.length - ? file.replace(root, SOURCECODE_BASEURL) - : undefined // Read & parse doc @@ -112,7 +108,13 @@ async function _getDocs( const title: string = frontmatter.title ?? _lastSegment.replace(/\-/g, ' ') const description: string = frontmatter.description ?? '' + const sourcecode: string = frontmatter.sourcecode ?? '' + const SOURCECODE_BASEURL = process.env.SOURCECODE_BASEURL + const sourcecodeURL = SOURCECODE_BASEURL?.length + ? `${SOURCECODE_BASEURL}/${sourcecode}` + : undefined + const nav: number = frontmatter.nav ?? Infinity const frontmatterImage: string | undefined = frontmatter.image