Skip to content

Commit

Permalink
fix: sourcecodeURL
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Sep 3, 2024
1 parent 2769332 commit 13ab656
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/getting-started/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
10 changes: 6 additions & 4 deletions src/utils/docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 13ab656

Please sign in to comment.